I am trying to a link from a google web page
this is my google link
import libraries
from urllib.request import urlopen from bs4 import BeautifulSoup
specify the url
Connect to the website and return the html to the variable ‘page’
try: page = urlopen(fetchUrl) except: print("Error opening the URL")
parse the html using beautiful soup and store in variable soup
soup = BeautifulSoup(page, 'html.parser') all_div = soup.find("div", {"class": "e2Bnf U7izfe"})
print("content:",all_div)
print("c_len:",len(content))
At the end i had to find a specific link from a div class="e2Bnf U7izfe"
but i am getting some random link
Aucun commentaire:
Enregistrer un commentaire