#iFrame
driver.switch_to.frame(driver.find_element_by_css_selector("#iFrameResizer0"))
#Findings elements
time.sleep(2) #Sleep to avoid 'laiks' error?
laiks = driver.find_elements_by_class_name("event-date-time__time")
time.sleep(3)
speles = driver.find_elements_by_class_name("event-block-row__name")
time.sleep(4)
odds = driver.find_elements_by_class_name("odd__value")
if laiks and speles and odds is not None:
print("Plkst., Spēlētāji, Koeficients:")
#Create datas.txt, write into it
with open("datas.txt", "w") as output:
for viss in laiks + speles + odds:
#Print in console the above
print(viss.text);
#Write in output file
output.write(viss.text + " | ")
This produces the following in the data.txt file:
23:30 | 23:30 | 22:00 | 22:30 | 23:30 | 08:00 | 11:00 | 14:00 | 16:00 | 15:00 | 18:30 | 22:00 | 15:00 | 20:00 | Havan Liberty - Isurus Gaming | Boom.id - Sharks Esports | Sector One - 4Elements Esports | Sprout - Divizon | Gamefist - Jointheforce | Touch The Crown - Unicorns of Love | Unicorns of Love - Touch The Crown | Huat Zai - After Gaming | Beyond Esports - Zigma | Tiger - Invictus Gaming | C0ntact Gaming - Mousesports | North - Sprout | Natus Vincere - Mousesports | Complexity Gaming - ENCE | BIG - Team Spirit | Astralis - Heroic | Evil Geniuses - Furia Esports | Liquid - 100 Thieves | 2.08 | 1.67 | 1.48 | 2.42 | 3.70 | 1.25 |
However, this is not the desired result and is hard to understand. First value of "laiks" represents first value of "speles" and first two "odds" values.
23:30 | Havan Liberty - Isurus Gaming | 2.08 | 1.67 |
23:30 | Boom.id - Sharks Esports | 1.48 | 2.42 |
How would I do this?