phantomjs

PhantomJS: submit a form

喜欢而已 提交于 2020-01-05 12:01:51
问题 I am filling out and submitting a form using PhantomJS and then outputting the resulting page. The thing is, I have no idea if this thing is being submitted at all. I print the resulting page, but it's the same as the original page. I don't know if this is because it redirects back or I didn't submit it or I need to wait longer or or or. In a real browser it sends a GET and receives a cookie, which it uses to send more GETS before eventually receiving the final result - flight data. I copied

PhantomJS arguments.js example UTF-8 not working

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-05 08:43:29
问题 NOTE : This might be related to the question I already asked Highcharts export server special characters replaced with question mark. The PhantomJS arguments.js example returns the parameters you give. Example : phantomjs arguments.js a b c Returns : 0: arguments.js 1: a 2: b 3: c On Mac OS X with PhantomJS 1.9.0 installed, I have no problem returning arguments with special characters. But on the remote server I'm working with (Linux Debian 6), it does not work as expected : phantomjs

Codeception - “ Curl error thrown for http POST to /session with params:”

三世轮回 提交于 2020-01-05 05:32:05
问题 first of all, sorry for my poor english. I have a problem with the test automation. I am a beginner. I have virtual box instance with my app, where is set a standard address with VirtualBox outside (192.168.56.101). I connect netbeans with this instance, and i have project with my app on this. And the last thing - I'm trying to biuld test automation for it. Unfortunately, I have a problem,. Test is created, selenium started, PhantomJs also started. I go to the project folder, "codecept run"

08.Python网络爬虫之图片懒加载技术、selenium和PhantomJS

僤鯓⒐⒋嵵緔 提交于 2020-01-05 05:20:44
引入 今日概要 图片懒加载 selenium phantomJs 谷歌无头浏览器 知识点回顾 验证码处理流程 今日详情 动态数据加载处理 一.图片懒加载 什么是图片懒加载? 案例分析:抓取站长素材http://sc.chinaz.com/中的图片数据 #!/usr/bin/env python # -*- coding:utf-8 -*- import requests from lxml import etree if __name__ == "__main__": url = 'http://sc.chinaz.com/tupian/gudianmeinvtupian.html' headers = { 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36', } #获取页面文本数据 response = requests.get(url=url,headers=headers) response.encoding = 'utf-8' page_text = response.text #解析页面数据(获取页面中的图片链接) #创建etree对象 tree =

「UI 测试自动化selenium」汇总

人盡茶涼 提交于 2020-01-05 03:37:00
8-1 selenium动态网页请求与模拟登录知乎 Ⅰ、介绍selenium 1.什么是selenium: selenium百度百科 2.selenium的构架图: 如果要操作浏览器,还需要一个drive。 Ⅱ、安装selenium 1.可以 pip install selenium。 2.找selenium的文档(比较难找)。 如图: 找到Drive,下载对应浏览器的drive,推荐用chrome(如果打不开就要VPN下载) Ⅲ、使用selenium 1 # -*- coding: utf-8 -*- 2 3 from selenium import webdriver 4 from scrapy.selector import Selector 5 6 7 #知乎的模拟登录 8 browser = webdriver.Chrome(executable_path="E:/chromedriver.exe") #路径是chromedriver.exe的存放的位置 9 browser.get("https://www.zhihu.com/#signin") 10 browser.find_element_by_css_selector(".view-signin input[name='account']").send_keys("********") #帐号 11 browser

How to get poltergeist/PhantomJS to delay returning the page to Capybara until AJAX is loaded?

て烟熏妆下的殇ゞ 提交于 2020-01-04 15:27:54
问题 How do I keep PhantomJS from returning the page to Capybara for several seconds to allow AJAX to finish loading? The HTML body I am getting back is: <!--div class='loading'>PLEASE WAIT WHILE PAGE LOADS</div--> Which is telling me that PhantomJS returned the page before the page finished loading its AJAX assets. Is there any way I can slow this down? I've tried using the rasterize.js solution but it looks as though any script I add to poltergeist's "phantomjs_options" hash is overlooked. 回答1:

AttributeError: 'NoneType' object has no attribute 'close'

做~自己de王妃 提交于 2020-01-04 14:22:10
问题 I am new to python js I am trying to run a project that are available on github but when I am trying to run it gives following error Traceback (most recent call last): File "main.py", line 81, in <module> crawler_machine() File "main.py", line 76, in crawler_machine driver.close() AttributeError: 'NoneType' object has no attribute 'close' Exception AttributeError: "'Service' object has no attribute 'process'" in <bound method Service.__del__ of <selenium.webdriver.phantomjs.service.Service

AttributeError: 'NoneType' object has no attribute 'close'

旧时模样 提交于 2020-01-04 14:20:58
问题 I am new to python js I am trying to run a project that are available on github but when I am trying to run it gives following error Traceback (most recent call last): File "main.py", line 81, in <module> crawler_machine() File "main.py", line 76, in crawler_machine driver.close() AttributeError: 'NoneType' object has no attribute 'close' Exception AttributeError: "'Service' object has no attribute 'process'" in <bound method Service.__del__ of <selenium.webdriver.phantomjs.service.Service

running phantomjs inside python virtualenv for selenium project

若如初见. 提交于 2020-01-04 12:40:47
问题 I am on OSX I need to use PhantomJS in a Python#3.5 scrapper running with selenium. I wrote a working program without setting a virtual environnement first. It works fine, but now I started building a virtual environnement with virtualenv and copied my code inside the newly created environnement. Everything is working fine... But PhantomJs and Firefox. I specified the path to phantomJS driver = webdriver.PhantomJS(executable_path=r'/Users/Me/.npm-packages/bin/phantomjs') I get : selenium

Cucumber/Capybara: tests fail randomly under PhantomJS

一世执手 提交于 2020-01-04 09:57:07
问题 When I run cucumber scenarios under PhantomJS I get Capybara::ElementNotFound: Unable to find css ".given_class" exceptions in random places it looks like driver does not wait for element appearance I'm using: Ruby 2.0 Cucumber 1.3.6 Capybara 2.1.0 Selenium-webdriver 2.35.1 PhantomJS 1.9.1 回答1: Capybara, particularly with PhantomJS will load a page really quickly, and perform checks for elements. As such, some elements may not have loaded and tests fail. By default capybara has a wait time of