Apr-11-2020, 04:24 PM
(Apr-11-2020, 04:02 PM)Larz60+ Wrote:Quote:The code run fine but the save method doesn't work as i wantedThis code cannot fetch a webpage as written
what is value of url after line 7?
print it out and see for yourself.
add after line 7:
print(f"url: {url}")
In addition, you need to attach a portion of data.txt (or entire file if small)
I changed the names of the URLs and elements, this part is works fine.
The data.txt looks like this:
sample1
sample2
sample3
sample4
I'm looking for these words on the pages. When he program program fininshed the export.xlsx contains only "sample4" (or the last) related things.
If I stopped it after "sample2" the export.xlsx contains only "sample2" related things.
I think somehow I need get out the df.to_excel from the loop, but when I do this, the export.xlsx doesn't save anything.