L
L
LesIy2020-06-06 19:21:34
Python
LesIy, 2020-06-06 19:21:34

Why are the letters of the text received by Selenium displayed in a column?

#Import libraries
import time
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import TimeoutException
#Include chromedriver
chromedriver = '/Users/User/Desktop/parser/chromedriver'
driver = webdriver.Chrome(chromedriver)

driver.implicitly_wait(20) # seconds
driver.get(' https://1x-bet28462.com/en/results/ ' )
team = driver.find_element_by_xpath("//div[@class='c-games__item']").text
for i in team:
print(i)

driver.quit()

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
ScriptKiddo, 2020-06-06
@LesIy

So you are looking for only one element

find_element_by_xpath("//div[@class='c-games__item']").text

Edit as follows. You may need to change the XPATH
teams = driver.find_elements_by_xpath("//div[@class='c-games__item']")
for i in teams:
    print(i.text)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question