Web scraping results in 403 Forbidden Error

后端 未结 3 1164
时光取名叫无心
时光取名叫无心 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条回答
  •  情深已故
    2021-01-06 08:36

    For anyone out there using PyQuery:

    from pyquery import PyQuery as pq
    import requests
    
    
    page = pq('https://seekingalpha.com/article/4151372-tesla-fools-media-model-s-model-x-demand', proxies={'http':'34.231.147.235:8080'})
    print(page)
    
    • (Used proxy info from https://free-proxy-list.net/)
    • Make sure you are using the Requests library and not Urllib. Don't try and load a page with 'urlopen'.

提交回复
热议问题