Python imports Images Based on phantomjs,

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.