I've written a script in python to get the content (which are in tabular format) of a site. When I execute my script, It does parse that content successfully. The only thing I can't modify is the language option.
The content of that sites are in Arabic
language. However, my intention is to parse that in such a way so that the output I'll get is in english. This is where I'm stuck. I tried with headers={"Accept-Language":"en-US,en;q=0.9"}
according to this answer but it doesn't seem to work in this case. How can I change the language option to serve the purpose?
This is my script:
import requests
from bs4 import BeautifulSoup
URL = "http://www.awm.gov.jo/dotnet/default.aspx"
req = requests.get(URL,headers={"Accept-Language":"en-US,en;q=0.9"})
soup = BeautifulSoup(req.text,"lxml")
for items in soup.select("#GV_prices tr"):
data = [item.get_text(strip=True) for item in items.select("th,td")]
print(data)
FYI, this was headers={"Accept-Language": "en-US,en;q=0.5"}
my first try but It didn't work either.