+ 1
get text off the net, then compare it with a previously retrieved text file.
I am trying to get a listing off the net (currently a web page) and compare it with another list, and write the changes to yet another file. I would like to do this through python. I know that it can be done, just how, I am a bit foggy on... OK then, completely blind. any help would be so appreciated. thanks I n advance .
2 Antworten
+ 1
simple way to read content of the web page:
import urllib.request
with urllib.request.urlopen("http://mlacu.ga") as url:
print(url.read())
more about how this works here https://docs.python.org/3/howto/urllib2.html .
after you fetch the content you will need to parse it. this can be done with regular expressions if the structure of the web page is not too complicated or you will need some more sophisticated parser.
note that the example above will not work in code playground (you will get "Memory limit exceeded" error when trying to import urllib.request).
+ 1
Thanks heaps REDANT. I appreciate you taking the time out to help fellow brother python. Thank you so much. Any other help, from my brothers in arms, would still help. The more the merrier.
The Bunyip