I am trying to scrape pages from this website Text The pages in Arabic and French have the same URL I tried the following code
headers = {'Accept-Language': "lang=\"AR-DZ"}
r = requests.get("http://www.mae.gov.dz/news_article/6396.aspx",headers)
soup = BeautifulSoup(r.content,"lxml")
print(soup.getText)
I get the following error message:
<bound method Tag.get_text of <html><head><title>Request Rejected</title></head><body>The requested URL was rejected. Please consult with your administrator.<br/><br/>Your support ID is: 12750291427324767866<br/><br/><a href="javascript:history.back();">[Go Back]</a></body></html>>
when I remove the header Beautifulsoup scrapes the page in French.
My goal is to scrape the statements and speeches in Arabic in order to build a corpus. Any help appreciated.