【发布时间】:2020-11-24 20:36:01
【问题描述】:
我试图弄清楚如何找到仅在单击网页上的按钮时才显示的隐藏值。我在网络日志中看不到任何发送另一个获取请求以显示隐藏值的内容。如何获取网页上的隐藏值?
这是我的代码:
product_page = self.url_session.get(
'https://www.finishline.com/store/product/nike-mamba-fury-basketball-shoes/prod2797512',
headers={
'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
'accept-encoding': 'gzip, deflate, br',
'accept-language': 'en-US,en;q=0.9',
'cache-control': 'max-age=0',
'sec-fetch-dest': 'document',
'sec-fetch-mode': 'navigate',
'sec-fetch-user': '?1',
'upgrade-insecure-requests': '1',
'user-agent': user-agent
},
params={
'styleId': f'{styleId}',
'colorId': f'{colorId}'
},
cookies={
'_abck': cookie # This gets a cookie
}
)
我试图在 html 中显示“cartCatalogRefIds”值。
【问题讨论】:
-
需要点击页面上的什么元素才能出现
cartCatalogRefIds的value? -
这是“添加到包”按钮。
标签: python beautifulsoup python-requests