How to crawl web pages that change the active tab after page loading into Python?

Asked 2 years ago, Updated 2 years ago, 51 views

Hello.

Writing code for crawling.

https://www.decantalo.com/kr/en/at-roca-brut-reserva.html#/1-volume-75_cl/111-year-2018

If you run the URL above with a browser, you can see that the 2019 tab is activated when the web page is loaded and then changes to the 2018 tab after the loading is completed.

I just crawled this page to Request or Selenium, and I only crawled the value with the 2019 tab activated, so is there a way to crawl it after waiting until the 2018 tab changes?

I don't know much about HTML or javascript, so I can't progress because it's blocked here.

I'd appreciate your help.

python selenium

2022-09-20 11:16

1 Answers

HTML tags corresponding to 2018 tabs at certain times:

<div class=" choose-combination-label">

Why don't you check to see if the active class is attached?

The CSS Path in the above tag is div.choose-combination-label:nth-child(2).

document.querySelector('div.choose-combination-label:nth-child(2)').className; 
// // "choose-combination-label active"


2022-09-20 11:16

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.