PHANTOMJS has been marked as outdated by selenium

Source: Internet
Author: User
Tags deprecated

Today when using PHANTOMJS, selenium hint Phantomjs was marked disapproval, I was blindfolded. PHANTOMJS is a well-known version of the Headless browser, marked as outdated, which means that this support will be discarded in future releases. So it's better to discard the PHANTOMJS and switch to the recommended headless Chrome first.

Python 3.6.4 (default, Jan  5 2018, 02:35:40) [GCC 7.2.1 20171224] on linuxType "help", "copyright", "credits" or "license" for more information.>>> from selenium import webdriver>>> driver=webdriver.PhantomJS()/usr/lib/python3.6/site-packages/selenium/webdriver/phantomjs/webdriver.py:49: UserWarning: Selenium support for PhantomJS has been deprecated, please use headless versions of Chrome or Firefox instead  warnings.warn(‘Selenium support for PhantomJS has been deprecated, please use headless ‘
How to use Headless Chrome

Headless mode is a new feature in Chrome 59.
To use chrome, you need to install Chromedriver.

from selenium import webdriverfrom selenium.webdriver.chrome.options import Optionschrome_options = Options()chrome_options.add_argument(‘--headless‘)chrome_options.add_argument(‘--disable-gpu‘)driver = webdriver.Chrome(chrome_options=chrome_options)driver.get("https://cnblogs.com/")

Other uses are basically the same as PHANTOMJS.
For more information, please see the official documentation.

Reference: Https://developers.google.com/web/updates/2017/04/headless-chrome

PHANTOMJS has been marked as outdated by selenium

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: info-contact@alibabacloud.com 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.