1

I am new to Python and web scraping. I am trying to scrape articles from a website but getting "406 Not Acceptable" when I run this code. Please help.

from requests import get
source_site_home_page = "https://www.readlightnovel.org/"
r = get(source_site_home_page)
print(r.text)
Faheem Akhtar
  • 93
  • 1
  • 2
  • 13

1 Answers1

1

Add the user agent flags like in this thread : Python Requests HTTP Response 406

r.status_codegives you code 200 because the request was successful!

The contents of the page should be in r.text

Henry Le Berre
  • 910
  • 9
  • 18