Веб-сайт основан на Java, и я пытаюсь разбить его на страницы, чтобы очистить данные, но разбиение на страницы не работает. Пожалуйста, помогите.
Вот сайт - https://edge.pse.com.ph/financialReports/form.do
# Function to extract report IDs from the current page
def extract_report_ids():
annual_report_links = driver.find_elements(By.XPATH, "//a[contains(@onclick, 'openPopup')]")
for annual_report_link in annual_report_links:
onclick_value = annual_report_link.get_attribute("onclick")
start_index = onclick_value.find("openPopup('") + len("openPopup('")
end_index = onclick_value.find("');")
report_id = onclick_value[start_index:end_index]
print("Report ID:", report_id)
# Extract report IDs from the first page
extract_report_ids()
# Iterate through all pages
while True:
try:
# Find the "Next" button
next_button = driver.find_element(By.XPATH, "//a[@onclick=\"goPage(2);return false;\"]")
# Scroll to the "Next" button
actions = ActionChains(driver)
actions.move_to_element(next_button).perform()
# Click the "Next" button
next_button.click()
# Wait until the list of report links on the page changes, indicating that the new page has loaded
WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//a[contains(@onclick, 'openPopup')]")))
# Extract report IDs from the current page
extract_report_ids()
except Exception as e:
print("Error:", e)
break
Подробнее здесь: https://stackoverflow.com/questions/784 ... -in-python
Возникли проблемы с разбивкой на страницы веб-сайта с использованием селена в Python. ⇐ Python
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Веб-скрапинг веб-сайта с таблицей с разбивкой на страницы, но без кнопки «Далее»
Anonymous » » в форуме Python - 0 Ответы
- 15 Просмотры
-
Последнее сообщение Anonymous
-
-
-
Веб-скрапинг веб-сайта с таблицей с разбивкой на страницы, но без кнопки «Далее»
Anonymous » » в форуме Python - 0 Ответы
- 9 Просмотры
-
Последнее сообщение Anonymous
-
-
-
Получение записей с разбивкой на страницы с использованием языка базы данных DB2 на C#
Anonymous » » в форуме C# - 0 Ответы
- 476 Просмотры
-
Последнее сообщение Anonymous
-