Dear stackoverflow community,
I recently ran into trouble trying to extract data from:
https://www2.sgx.com/securities/corporate-information?country=SINGAPORE
My purpose is to click each link in the table, starting from 3CNERGY LIMITED, which opens up another webpage tab, extract that, close that tab after extracting, go back to the main page, and click the next link.
My issues are: unable to find the element that lets me loop thru the table and unable to switch from main webpage to tab and then back.
My progress: i thought
<sgx-table-list data-rendered-rows="20" data-visible-rows="10" style="min-width: 560px; transform: translateY(0px);" data-rendered-index="0" data-visible-index="0" xpath="1">
would allow me to loop thru the table but the len returns 1 only..
i've been able to click the first webpage using:
CE = driver.find_element_by_xpath("//a[contains(@href, 'infopub')]")
but without being able to loop thru the table, the script just performs the first click. Also, i cant change it to find elements by xpath because it becomes a list and .click() doesn't work.
Any help will be greatly appreciated. Thanks!!
Aucun commentaire:
Enregistrer un commentaire