I want to use Python to crawl app's version history from Apple Store, for instance: https://apps.apple.com/us/app/netflix/id363590051
To do so, I need to click on the Version History button in What’s New section. Below is the html of Version History, as you can see there is NO url link included:
<div class="version-history">
<button class="we-modal__show link section__nav__see-all-link"
id="modal-trigger-ember107103210"
data-metrics-click="{"actionType":"open","targetType":"button","targetId":"ModalVersionHistory"}"
type="button">Version History</button>
<!----></div>
After clicking the Version History button, a new window containing version info appears within the same page, its html shows like:
<div id="modal-container"> ...version information... </div>
While previously this element was an empty:
<div id="modal-container"></div>
I think it is using Bootstrap’s JavaScript modal plugin. But I have no idea about how to crawl the content requires button click and without url provided above. Could anyone give advice on how to implement this? I have Firefox selenium/requests installed in python. Thanks in advance!
CodePudding user response:
Basically I find a solution. With Selenium, I can using element_to_be_clickable plus Xpath to find the button then click the button. The driver will return the content of the new page
CodePudding user response:
There are two options to show new content after click. 1. Its already loaded and in embedded in sourcecode. 2. A new request gets sended on click event. If its a new Request you can send the request for yourself. But on this page its option 1. So there is a including this data as json.