adultsitem Wrote:I'm beginner level so I have very little knowladge sorry.You should still try something an post that code,as reading a file has a lot of tutorial out there
![Wink Wink](https://python-forum.io/images/smilies/wink.png)
Let's say have a
ua.txt
file like this.Output:user-agent=Mozilla/5.0 1111
user-agent=Mozilla/5.0 2222
user-agent=Mozilla/5.0 3333
Read and make a list,then can eg choice a random from that list.import random with open('ua.txt') as f: ua = [i.strip() for i in f] first = ua[0] rand_ua = random.choice(ua) print(first) print(rand_ua)
Output:user-agent=Mozilla/5.0 1111
user-agent=Mozilla/5.0 3333