Python imports Images Based on phantomjs,
The phantomjs-based automation will appear
1. flash is not supported
2. Some view-based buttons cannot 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 an image link sleep (0.5) autoit. send ("{TAB} {ENTER}") # click OK # The preceding method is used to operate the browser with an interface. webdriver browser.exe cute_script ("document. getElementById (\ "input_upload_image1 \"). type = 'text'; ") # An input box exists for normal flash upload operations, but normally it is den. You can use js to display it in 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 all the content in this article. I hope it will be helpful for you to learn how to use phantomjs.