vendredi 23 avril 2021

Web Scraping Customer Reviews

I'm trying to scrape customer reviews from G2 as part of a project for my job but getting 403 error, any idea on how to go about this, I'm quite new to web scraping. Much appreciated!

HTTPError: HTTP Error 403: Forbidden

from urllib.request import Request, urlopen

req = Request("https://www.g2.com/products/google-drive/reviews", headers={'User-Agent': 'Mozilla/5.0'})

web_byte = urlopen(req).read()

webpage = web_byte.decode('utf-8')

parsed_html = BeautifulSoup(webpage, features="lxml")



Aucun commentaire:

Enregistrer un commentaire