首页 > 解决方案 > how to parse a website if the url of the search request is changing

问题描述

I have a stock website that I want to parse some content to a csv file for now. I'm using Python requests HTML or beautifulsoap.

The problem is the URL is changing. the website https://www.tadawul.com.sa/

an example of a stock: https://www.tadawul.com.sa/wps/portal/tadawul/market-participants/issuers/issuers-directory/company-details/!ut/p/z1/04_Sj9CPykssy0xPLMnMz0vMAfIjo8zi_Tx8nD0MLIy83V1DjA0czVx8nYP8PI0MDAz0I4EKzBEKDEJDLYEKjJ0DA11MjQzcTfXDCSkoyE7zBAC-SKhH/?companySymbol=6002

This "04_Sj9CPykssy0xPLM...." is periodically changing. why is it changing? how can I parse the webpage?

I found the same data in the page source

is there a better way to parse pages in this website?

标签: pythonpython-3.xweb-scrapingpython-requestshtml-parsing

解决方案



推荐阅读