【发布时间】:2021-01-04 06:52:47
【问题描述】:
详情: 我已经使用 id & 'xpath' 尝试了下面的代码,并在输入标签处添加了带有 'block' 的显示块状态。但它仍然无法在页面上附加任何 pdf 文件。
URL = "https://hk.jobsdb.com/hk/en/Job/NonMemberApplication?jobAdIdList=100003008140517&pass=true&trackData=%7B%22ApplySource%22%3A1%7D&token=0~8e61b1eb-cfc1-4de7-bb5a-706976405da2§ionRank=1"
driver.get(URL)
time.sleep(3)
container = driver.find_element_by_name("userfile")
driver.execute_script("arguments[0].style.display':' 'block';", container)
input = driver.find_element_by_id('UploadButtonc_NnMrAnItD3p_AhRe0')
input.send_keys('file path')
time.sleep(1)[enter image description here][1]
driver.close()
错误信息
selenium.common.exceptions.JavascriptException Messagejavascript 错误 Unexpected token ':'
Thanks
【问题讨论】: