SoFunction
Updated on 2024-11-14

python based phantomjs implementation of importing images

automation based on phantomjs, there will be

unsupported

2. Some view-based buttons can't be clicked, and some buttons are flash-based (especially the upload button).

browser.find_element_by_xpath(".//*[@name='SWFUpload_0']").click()  #Click the upload button
sleep(2)
autoit.control_set_text("", "[CLASS:Edit; INSTANCE:1]",tupian )  #Upload image link
sleep(0.5)
("{TAB}{TAB}{ENTER}")  # Click OK
 
# This is how to operate a browser with an interface. webdriver
 
browser.execute_script("(\"input_upload_image1\").type='text';")       #Normal flash operation upload, there will be an input box, but normally will be hidden, you can show it through js
browser.find_element_by_xpath(".//*[@id='input_upload_image1']").send_keys('*********') #upload link
 
browser.find_element_by_xpath(".//*[@id='pub_submit']").click() 

The above is the entire content of this article, I hope you learn to use phantomjs can help.