Web scraping results in 403 Forbidden Error

后端 未结 3 1154
时光取名叫无心
时光取名叫无心 2021-01-06 08:14

I\'m trying to web scrape the earnings for each company off SeekingAlpha using BeautifulSoup. However, it seems like the site is detecting that a web scraper is being used?

3条回答
  •  Happy的楠姐
    2021-01-06 08:39

    You should try setting User-Agent as one of request headers. Value can be of any known browser.

    Example:

    Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36

提交回复
热议问题