To receive an answer from requests.get
I should provide it cookies and User-Agent.
Here is my code:
URL = 'https://www.alljobs.co.il/SearchResultsGuest.aspx'
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:80.0) Gecko/20100101 Firefox/80.0',
'Cookie': 'some Cookie string'
}
def get_html(url, params=''):
r = requests.get(url, headers=headers, params=params)
return r.text
params = {'page': 1, 'position': '765', 'type': '', 'city': '', 'region': ''}
html = get_html(URL, params=params)
I take the cookies and User-Agent from the browser's debugger. The question if there more elegant ways to do it, I mean not to copy past it manually.