I try access to results home of Manchester United but impossible to access. .Here is the website page
And here is below a piece of code HTML the page:
<div id="g_1_l2dtbMED" title="Click for match detail!" class="event__match event__match--static event__match--last event__match--oneLine"><div class="event__time">04.10. 17:30</div><div class="event__participant event__participant--home"><svg class="card___2ip_DLm icon--redCard icon--redCard-first icon--redCard-last"><title></title><use xlink:href="/res/_fs/build/symbols.f1bc6b2.svg#card"></use></svg>Manchester Utd</div><div class="event__scores fontBold"><span>1</span> - <span>6</span></div><div class="event__participant event__participant--away fontBold">Tottenham</div><div class="event__part">(1 - 4)</div><span class="wld wld--l" title="Loss">L</span></div>
The results that I to search parse is 'L' and is located in balise <span>.
Here is the code that I did for try parse it:
driver = webdriver.Chrome()
url = "https://www.flashscore.com/team/manchester-united/ppjDR086/results/"
driver.get(url)
Team = 'manchester Utd'
results = WebDriverWait(driver, 20).until(EC.find_elements((By.XPATH,"//div[@class='event__participant--home' and contains(text(),'"+ Team +"')]//ancestor::div/span")))
print(len(results))
But this cast me exception 'TimeoutException' after 20s that is time limit of search.