【发布时间】:2017-05-28 23:43:05
【问题描述】:
如何从基于leafletjs 的地图弹出框中获取文本。 url is this。我也收到此错误:NoSuchElementException
如果我搜索包裹并输入如下所示的相关信息,那么我想获取带有 class_name: 'leaflet-popup-content' 的框上的所有文本?
# Creates an instance driver object...
driver = webdriver.Chrome()
# load the url above
driver.get(url)
# =============
# Find and fill SEARCH BOX by id....
driver.find_element_by_id('searchBox').send_keys('1083CX')
# Send the form by clicking on the searcht botton...
driver.find_element_by_id('searchButton').click()
driver.find_element_by_id('listElementContent0').click()
# driver.find_element_by_class_name('content').click()
# =============
txt = driver.find_element_by_class_name('leaflet-popup-content').text()
print (txt)
What is the best way to avoid NoSuchElementException in Selenium? 的这个问题的分析器使用了 Java,我不明白。我正在使用 Python 并且对这一切都不熟悉?
【问题讨论】:
标签: javascript python selenium selenium-webdriver leaflet