【发布时间】:2019-01-14 01:38:56
【问题描述】:
有一个地图设计网站,该网站的信息被“web.archive.org”作为快照。不过,我需要的几乎所有信息都可以在此快照中读取。网址是“https://web.archive.org/web/20130601211515/http://rasatlar.dsi.gov.tr/”。
当鼠标碰到一个本身有几何位置的点图时,在右下角的方框内会显示一个带有代码的标题和另一个信息,并且可以看到它的X和Y位置(纬度,经度)信息在右下角。我需要收集本站保留的这些 X、Y 位置和标题、代码信息。
下面的脚本尝试在框中打印文本,但我也有这个错误。
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
driver = webdriver.Chrome(executable_path=r'D:\chromedriver.exe')
driver.implicitly_wait(30)
base_url = "https://www.katalon.com/"
verificationErrors = []
accept_next_alert = True
driver.get("https://web.archive.org/web/20130601211515/http://rasatlar.dsi.gov.tr/")
a= driver.find_element_by_id("OpenLayers_Geometry_Point_6795")
hover = ActionChains(driver).move_to_element(a)
#driver.find_element_by_id("draggable").click()
b= driver.find_element_by_xpath((By.XPATH,"//*[@id='draggable']/p[1]")).text
print (b)
错误:
WebDriverException: invalid argument: 'value' must be a string
【问题讨论】:
标签: image selenium dictionary web-scraping location