1 Resposta
0
What you are trying to make is called a "web crawler". There are libraries to help you with this. I would suggest watching these tutorials which will explain how to make one:
Part 1: https://youtu.be/XjNm9bazxn8
Part 2: https://youtu.be/sVNJOiTBi_8
Part 3: https://youtu.be/pLHejmLB16o
For the text file part use built in file editing
e.g
# opens/creates file "example.txt" then writes everything in the web_info
# variable into it
with open("example.txt", "w") as f:
f.write(web_info)
OR
try:
f = open("example.txt", "w")
f.write(web_info)
finally:
f.close()
***Warning: as stated in the first part, web crawling on some websites is against their policies***
I hope that helps