-1

I am trying to scrape news headlines and links using BeautifulSoup from https://www.blade.com/news but keep running into HTTPError: HTTP Error 403: Forbidden.

I am using headers and requests, but still get the error, here is my code:

from urllib.request import urlopen, Request
from bs4 import BeautifulSoup 
import datetime

blade = "https://www.blade.com/news"
req = Request(blade, headers={'User-Agent':'Mozilla/5.0'})
bladehtml = urlopen(req)
soup3 = BeautifulSoup(bladehtml, 'lxml')
type(soup3)

I am not sure why I keep getting the error with the browser header in place. Any help would be appreciated!

Ian
  • 17
  • 1

1 Answers1

1

The Website you are trying to scrape is cloudfire protected,Use selenium if in a hurry this might help Python - Request being blocked by Cloudflare