I have rows of links contained in a dataframe.
df = pd.DataFrame()
I need to iterate over the rows of links in the dataframe one at a time so I can perform selenium tasks on each link separately. It should iterate over these rows in a loop until there are no more rows in the dataframe.
links
0 http://linkone
0 http://linktwo
0 http://linkthree
My logic is as follows
Loop
Get http://linkone in first row of dataframe
Use selenium to perform tasks, such as driver.get(http://linkone)
Gather data from HTML from http://linkone
Continue loop and get row 2, row 3, etc.
In this case you dont need iterrows(), just use a for loop.
Simply use a for loop:
for link in df.links:
print(link)
print('do something with selenium')
http://linkone
do something with selenium
http://linktwo
do something with selenium
http://linkthree
do something with selenium
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With