I am having problems reading input from text file. Also I noticed that only the last line is read and parsed.
out1.txt:
thin279
gatefin
64hamp
testme
Code:
import time
from selenium.webdriver.chrome.options import Options
chrome_options = Options()
chrome_options.add_argument("--headless")
with open('out1.txt') as f:
for line in f:
#do not forget to strip the trailing new line
userid = line.rstrip("\n")
print (userid)
for i in range (len(userid)):
ucheck = ("https://example.com/?profile=" + userid)
xucheck = webdriver.Chrome(options=chrome_options)
xucheck.get(ucheck)
print (ucheck)
Below is the output showing only the last item in the list
=========== RESTART: C:/Users/Administrator/Desktop/project_3/qyes.py ==========
thin279
gatefin
64hamp
testme
https://example.com/?profile=testme
https://example.com/?profile=testme
https://example.com/?profile=testme
https://example.com/?profile=testme
https://example.com/?profile=testme
https://example.com/?profile=testme
>>>
So I want to know how to get it to all the userid and not just the last one (testme).