找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 1155|回复: 0

[Python] win7环境使用PhantomJS

[复制链接]

3万

主题

7

回帖

9万

积分

管理员

积分
91233
发表于 2021-6-29 23:07:46 | 显示全部楼层 |阅读模式
操作系统:win7 旗舰版 64位
python版本:python3
PhantomJS: phantomjs-2.1.1
1、从 PhantomJS官方网站下载PhantomJS
https://phantomjs.org/download.html
2、下载解压,将解压后PhantomJS的目录添加到win7系统的PATH的环境变量中;
3、在python3的模式下执行:
  1. >>> from selenium import webdriver
  2. >>> driver = webdriver.PhantomJS()
  3. >>> driver.get('http://www.baidu.com')
  4. >>> driver.page_source
复制代码


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|番茄论坛

GMT+8, 2024-9-20 01:42 , Processed in 0.084274 second(s), 21 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表