係唔係有問題? 我DOWNLOAD 唔到出黎? image = driver.find_element_by_xpath('//*[@id="1zPd8c73PH_5SM:"]') urllib.request.urlretrieve(image.get_attribute("src"), "filename.png") ('filename.png', <email.message.Message at 0x19c5ff27278>)
有冇出error?睇落冇問題,你比返個full path, 我諗係save左係第二個位
唔得?
File "<ipython-input-140-d6893a95aefc>", line 4 urllib.request.urlretrieve(image.get_attribute('src'), 'C:\Users\design1\Desktop\application\python\jupyter\download\filename.png') ^ SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape
加返r係path string 前面
OK try try thanks
https://www.pinterest.com 好似而個WEBSITE , dropdown menu 係select 唔到XPATH , 如果而個可以點解決? python 可以CALL Keyboard 做action 嗎?
我SELECT到DROP DOWN, KEYBOARD ACTION 係有既,但唔常用,可以參考: https://stackoverflow.com/questions/27775759/send-keys-control-click-in-selenium-with-python-bindings