This is what I tried to do:

import selenium 
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.common.keys import Keys
import pandas as pd

driver = webdriver.Chrome(ChromeDriverManager().install())
driver.get('https://www.yes.com.kh/support/find-shop')
#driver.ge`enter code here`t('https://hoopshype.com/salaries/players/')
#driver = webdriver.Chrome('/Users/syais/AppData/Local/Programs/Python/Python38/Scripts/')

location = driver.find_elements_by_xpath('//div[@class="d-title"]')
print(location)

#It returns empty value

inspect website

1

There are 1 best solutions below

0
On BEST ANSWER

To get title of al phone shop induce WebDriverWait() and wait for presence_of_all_elements_located() and to get the text use element.get_attribute("textContent")

driver.get("https://www.yes.com.kh/support/find-shop")
locations=WebDriverWait(driver,20).until(EC.presence_of_all_elements_located((By.XPATH,'//div[@class="item blog"]//div[@class="d-title"]')))
for location in locations:
    print(location.get_attribute("textContent"))

Import below libraries.

from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

Console Output:

Tit Heng Phone Shop
Nina2 Phone Shop
G B Phone Shop
Rathana Phone Shop
Chet Traprek Hou Phone Shop
Siv Heng Phone Shop
D Na Phone Shop
Heang Heang 2 Phone Shop
Rayuth Phone Shop
Virak Phone Shop
yes hub Sihanoukville
yes hub Sihanouk Ville International Airport
Kim Nai Houy
Kim Sreng phone shop
Por Sokleng
yes hub Battambang
Yorn Kim Err Phone Shop
Yorn Bunyan
Yon Hour Phone Shop
Yin Fuoy Phone Shop
yes hub Poipet
yes hub Serei Sorphorn
Sam Sophea
Kheang Lyhour
Rith Sovann
yes hub siem reap
yes hub Siem Reap International Airport
Vannak Phone Shopp
Rattanak Phone Shop
Hun Rithy Phone Shop
yes hub kep
yes hub takeo
yes hub kampong speu
Khoun Phalla Phone Shop
Pheng Nai phone shop
Pheng Chhunleng phon shop
Cheang Srong phone shop
yes hub Kampot
Thov Vannarith
Preap Samphors
yes hub kampong cham
Pea Vibuth Phone shop
Oeng Sopanha Phone Shop
Sorn Naro phone shop
Ka tangkea phone shop
yes hub pursat
yes hub svay rieng
Kim Veasna phone shop
Lim Sorphorn phone shop
Mao Sithan phone shop
Yuk Samorn phone shop
yes hub koh kong
yes hub pailin
Veng Hong 2 Phone Shop
Veasna Phone Shop
Van Seam Phone Shop
Srey Neth Phone Shop
yes hub Kampong Thom
yes hub Kampong Chhnang
yes hub prey veng