Answer the question
In order to leave comments, you need to log in
How to parse Google Chrome popup?
Good afternoon everyone. There is a Python script that goes to this page https://www.flashscore.ru/ and using Selenium clicks on each match and displays a link from this match. Time.sleep so that the js on the page has time to load.
The problem is that when you click on the match, it is not a window that opens, but the second browser, the code of this new window does not see it, it is still on the initial page https://www.flashscore.ru/ and it turns out that a link is displayed just a site, but not from the match. How can I take a link from each match? With or without Selenium? Thanks in advance.
The code:
from selenium import webdriver
import time
driver = webdriver.Chrome()
driver.get('https://www.flashscore.ru/')
time.sleep(13)
for channel in driver.find_elements_by_css_selector(".event__match.event__match--scheduled.event__match--oneLine"):
channel.click()
time.sleep(13)
link = driver.current_url
print(link)
https://www.flashscore.ru/
https://www.flashscore.ru/
https://www.flashscore.ru/
https://www.flashscore.ru/
https://www.flashscore.ru/
...
...
https://www.flashscore.ru/
https://www.flashscore.ru/match/lUKXoAEo/#match-summary
https://www.flashscore.ru/match/OnDpq8b4/#match-summary
https://www.flashscore.ru/match/llD7mNQ3/#match-summary
...
Answer the question
In order to leave comments, you need to log in
The ID property contains the ID of the match.
In the popup window the same ID
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question