Hi I am still a beginner at python and I was experimenting.
I am looking for a way to request a url and get the data of the webpage so the page does not need to open.
Once I get the data, I need to search the data for a tag, for example, if it has 'hello' somewhere on the home page that is requested.
Here is an example:
import urllib.request
fp = urllib.request.urlopen("http://www.python.org")
mybytes = fp.read()
mystr = mybytes.decode("utf8")
fp.close()
x = mystr.find('testing word tag');
print(x)
Please bear with me as I am still a rookie and can't find an example of what I am looking for.
^ found this code on here but it does not seem to work to find a string.
Anyone knows the best way to do it?
Thank you guys :)
BeautifulSoup