phantomjs

Anaconda环境下安装库

流过昼夜 提交于 2020-01-17 06:51:00
使用anaconda环境下使用pycharm后,有些其他库也想安装,但开始在python.exe目录下安装没成功,因为pycharm用的环境已经不是原始的python.exe解释器了。就总结了一些安装库的方法。 注:这些方法不是最简便的,仅供学习扩展用。 一、安装selenium库 1、下载anaconda 2、把anaconda中python解释器地址放在path环境变量中 3、在cmd中输入python,会看到anaconda运行解释器 4、pip install selenium 二、selenium库扩展:安装Chromedriver 下载链接: http://chromedriver.storage.googleapis.com/index.html https://chromedriver.storage.googleapis.com/2.39/notes.txt 下载完成后: windows 下,新建一个命名为chromedriver文件夹,将解压的chromedriver.exe放进文件夹,再配置进path环境变量 Linux下,把下载好的文件放在 /usr/bin 目录下就可以了。 三、安装PhantomJS库 (现在不维护了) 官网下载页面:http://phantomjs.org/download.html 去下载你对应操作系统版本的phantomjs

Bind Phantomjs to a Network Interface

喜你入骨 提交于 2020-01-17 03:44:30
问题 I currently have multiple network alias (eth0, eht0:1, eth0:2), each having their own private ip which has its own public ip. When using remote web driver with phantomjs (ghostdriver), it always chooses the local host (See BUG https://github.com/ariya/phantomjs/issues/10269), for client argument --webdriver=ip:port, thus I cannot rely on phantomjs to pick the correct interface. I am currently under the impression that I will have to use IPTABLES. I want to route ever instance of my java

yo angular generator error phantomjs install

人盡茶涼 提交于 2020-01-17 02:51:39
问题 I have tried installing yo anugular and got below error, I have tried updating node , npm , npm cache clean etc. but its not working. When I ran $ yo angular it goes and fetch dependencies using bower but its gives this error and move on npm WARN engine karma@0.12.31: wanted: {"node":"~0.8 || ~0.10"} (current: {"node":"0.12.0","npm":"2.5.0"}) ... > phantomjs@1.9.15 install /Users/jhondoe/Desktop/webapp/node_modules/karma-phantomjs-launcher/node_modules/phantomjs > node install.js Downloading

casperjs --web-security=no --cookies-file=/tmp/mycookies.txt myscript.js did not working

老子叫甜甜 提交于 2020-01-16 08:30:51
问题 Hi for me the command did not working: $ casperjs --web-security=no --cookies-file=/tmp/mycookies.txt myscript.js (just copied from the documentation of casperjs: http://docs.casperjs.org/en/latest/cli.html#casperjs-native-options) I have created the cookie file from another script. Now I want to implement the cookies into the second script. But the above command did not work. What I want, is to implement the cookies before the first page invoke. And yes the cookies are still alive, bcause if

怎么下载旧版本的Selenium

帅比萌擦擦* 提交于 2020-01-16 04:50:12
试运行一个爬虫: from bs4 import BeautifulSoup from selenium import webdriver import urllib driver = webdriver.PhantomJS( executable_path='/usr/local/bin/phantomjs') # 浏览器的地址 如果是windows,应该是某个exe地址 def search(keyword): url_keyword = urllib.parse.quote(keyword) url = " http://www.tianyancha.com/search/ " + url_keyword + "?checkFrom=searchBox" print(url) driver.get(url) bsObj = BeautifulSoup(driver.page_source, "html5lib") print(bsObj) company_list = bsObj.find_all("span", attrs={"ng-bind-html": "node.name | trustHtml"}) for company in company_list: print(company.get_text()) if name == ' main ': search(

【爬虫】大杀器——phantomJS+selenium

时光总嘲笑我的痴心妄想 提交于 2020-01-16 04:49:56
【爬虫】大杀器——phantomJS+selenium 视频地址 江湖上有一个传说,得倚天屠龙者可称霸武林。爬虫中也有两个大杀器,他们结合在一起时,无往不利,不管你静态网站还是动态网站,通吃。 phantomJS http://phantomjs.org/ 一种无头浏览器,何为无头浏览器,你可以看做一个无界面的浏览器,电脑能看到,人却看不到(没界面怎么看)。 下载安装: http://phantomjs.org/download.html selenium http://selenium-python.readthedocs.io/getting-started.html 能直接调用浏览器(打开浏览器,访问某个页面,获取页面信息等)。 安装命令: pip install selenium phantomJS + selenium phantomJS和selenium结合在一起就好像撼地神牛配上了跳刀、UG配上了辉耀、钢背兽配上了玲珑心。碰到搞不定的网站,直接上这两个大杀器。 举个例子 http://www.tianyancha.com/search/%E7%99%BE%E5%BA%A6%20%E6%9D%8E%E5%BD%A6%E5%AE%8F?checkFrom=searchBox 天眼查为了反爬虫可谓是煞费苦心,还专门招聘反爬虫工程师,真是丧心病狂 天眼查爬虫 python3

Can't get website image

隐身守侯 提交于 2020-01-16 04:32:20
问题 I am using PhantomJS to capture an image of a website built using Polymer. Here is my capture.js file: var page = require('webpage').create(); page.open('https://www.gosizzle.io/token/recruiting/957e73c45b55129b1a', function() { page.render('test1.png'); phantom.exit(); }); However when I run phantomjs capture.js my test1.png only contains the footer of the website: 来源: https://stackoverflow.com/questions/35610392/cant-get-website-image

PhantomJS.rb freezing when trying to screen capture page in my rails application

倖福魔咒の 提交于 2020-01-16 04:10:14
问题 I'm having trouble getting a screen capture from my application while using the phantomjs.rb gem. I'm currently just trying local url's. If I get those working I'll use url_for's later. In my controller: Phantomjs.run('./public/javascripts/testScreenCapture.js', 'http://localhost:3000') And my testScreenCapture.js: var page = require('webpage').create(); var args = require('system').args; var url = args[1]; page.open(url, function () { window.setTimeout(function () { page.render('./public

Selenium with PhantomJS: Form being validated but not submitted

别说谁变了你拦得住时间么 提交于 2020-01-15 18:50:15
问题 I'm having a strange problem submitting a form through Selenium Webdriver's PhantomJS API. Upon clicking the submit button, the form gets validated (are the username and password too short, or blank, etc.), but it does not get ultimately submitted. That is, if I submit an invalid form, and check the screenshot, there are alert notifications. If I submit a valid form, nothing happens. The JS on the page is supposed to validate the form, then submit it, when the submit button is clicked. A

Selenium with PhantomJS: Form being validated but not submitted

家住魔仙堡 提交于 2020-01-15 18:48:34
问题 I'm having a strange problem submitting a form through Selenium Webdriver's PhantomJS API. Upon clicking the submit button, the form gets validated (are the username and password too short, or blank, etc.), but it does not get ultimately submitted. That is, if I submit an invalid form, and check the screenshot, there are alert notifications. If I submit a valid form, nothing happens. The JS on the page is supposed to validate the form, then submit it, when the submit button is clicked. A