我在试着分析这个站点-https://www.rent-a-car-crete.gr/car-search/ 为了获得必要的信息,解析器必须输入以下数据
data = {
'pickup_location': '29',
'return_to_pickup_location': '1',
'return_location': '---',
'pickup': '21.02.2024',
'pickup_time': '10:00',
'return': '22.02.2024',
'return_time': '10:00',
'promo_code': '',
'age': '30+',
'pickup_id': '',
'return_id': '',
'subimt_search': '1',
}
(查看了网络上的完整榜单) 以及如何按下搜索按钮并解析出来的汽车
I tried to parse the main page - https://www.rent-a-car-crete.gr without a post request I received it, when sending a post request I also received it, I was not transferred to the page with the car, after looking at what I get when parsing the main page and the page described above, I realized that I get the same text everywhere, I can’t understand how I can achieve the result I need. Here are screenshots that can help and my code [] (https://i.stack.imgur.com/Ahv3c.png)
url = 'https://www.rent-a-car-crete.gr/car-search/'
urlpre = 'https://www.rent-a-car-crete.gr'
work = Session()
res = work.post(url=url, headers=headers,data=data)
soup = BeautifulSoup(res.content, 'html.parser')
cars = soup.find_all('h3', class_='carname')
print(res)
print('-'*50)
print(soup)
print('-'*50)
print(cars)