phantomjs

Python phantomjs loading webpage not correct

人走茶凉 提交于 2019-12-13 20:26:56
问题 I have an issue where extracting from this link http://www.bursamalaysia.com/market/listed-companies/company-announcements/#/?category=FA&sub_category=FA1&alphabetical=All&company=5250 brings me data from this link instead which is the main page itself. http://www.bursamalaysia.com/market/listed-companies/company-announcements/#/?category=all Any idea why is this occuring ? I am using PhantomJS selenium and beautiful soup to assit me in this. # The standard library modules import os import

CasperJS cannot set window.navigator object

谁说胖子不能爱 提交于 2019-12-13 20:13:49
问题 Trying to scrape a web page with CasperJS. Webpage checks to see if the browser is an IE 6/7. Passing an userAgent with casperjs doesn't seem to satisfy its condition. UserAgent passed: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) Following is the check being made by the page to determine the browser agt = navigator.userAgent.toLowerCase(); browserType = navigator.appName; if( ((browserType.indexOf("xplorer") != -1) && (agt.indexOf("msie 6.") != -1)) || ((browserType.indexOf("xplorer")

In PhantomJS, what is the function call stack limit?

蹲街弑〆低调 提交于 2019-12-13 19:45:37
问题 How many times can a function recursively call itself before breeching PhantomJS javascript engine's call stack limit? Said another way, what is the last possible n printed here for PhantomJS: var n = 0; function f() { console.log(++n); f(); } f(); 回答1: I've used your code and ran it in different PhantomJS versions on my PC and my Raspberry Pi 1 running Raspbian. Platform | Version | Maximum callstack -------------------------------------- Win 8.1 | 2.0.0 | 65277 Win 8.1 | 1.9.8 | 65534 Win 8

Unknown option when using CasperJS with “--ssl-protocol=tlsv1 --engine=slimerjs”

北慕城南 提交于 2019-12-13 19:30:37
问题 Every since the sslv3 POODLE bug came out I am unable to use casperjs with the "--engine=slimerjs" option. Before POODLE I was able to run my casperjs script like this: casperjs --engine=slimerjs script.js But after POODLE I needed to also send the "--ssl-protocol=tlsv1" to casperjs. This works without using the slimer option like this: casperjs --ssl-protocol=tlsv1 script.js Now if I want to use the slimerjs engine and send the ssl-protocol like this: casperjs --ssl-protocol=tlsv1 --engine

Scrape dynamic loading pages with phantomjs

我与影子孤独终老i 提交于 2019-12-13 18:59:27
问题 I am trying to scrape a quora log page like this Quora question log to get to the bottom of page and get the name of person who added the question. i am using this code for phantomjs var page = require('webpage').create(); var fs = require('fs'); var output = './temp_htmls/test1.html'; page.open('url', function() { fs.write(output,page.content,'w'); phantom.exit(); }); But this only fetches a single web page and cannot fetch complete webpage until end. Can someone point what i am missing with

Webshot gem is not capturing the finished page

半世苍凉 提交于 2019-12-13 18:45:44
问题 I am attempting to take screen shots of maps generated with mapbox. I successfully took screenshots until I started storing my data in a file, which mapbox recommends if you have a lot of data. (https://www.mapbox.com/help/working-with-large-geojson-data/#store-geojson-at-url) Now I get a white screen. I've added a timeout. It doesn't seem to matter how long I wait. I believe the data should be loaded via Ajax. I'm running this against a locally running web server. When I view the page using

Unable to handle alert using phantomJS in Java

孤街浪徒 提交于 2019-12-13 18:08:46
问题 I have a Java code as below and when I am running through PhantomJs getting "Unsupported Command Exception" but it is working fine if I run through firefox and chrome:- Note: With phantomJs we could able to execute till 3rd step in below code.I searched in many blogs but those answers didn't solve my problem. 1. cvvField.sendKeys(cvcData); 2. proceedToPayBtn.click(); 3. Reporter.log("Card details are submitted from payment UI page"); 4. Alert a1=driver.switchTo().alert(); 5. Reporter.log(

jQuery Ajax doesn't work in PhantomJS

送分小仙女□ 提交于 2019-12-13 17:07:42
问题 Whats wrong with this code? I'm trying to send a post request using jQuery ajax from PhantomJS, but it returns nothing besides " post: " var webPage = require('webpage'); var page = webPage.create(); page.includeJs('http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js', function() { console.log('post:'); $.post("http://httpbin.org/post", function(data) { console.log(data); }); }); 回答1: PhantomJS has two contexts. page.includeJs() instructs the DOM context (page context) to load the

Do Yahoo and Bing crawlers interpret JavaScript the way Google does? [duplicate]

拈花ヽ惹草 提交于 2019-12-13 13:31:49
问题 This question already has answers here : how do web crawlers handle javascript (6 answers) Closed 4 years ago . I have an Angular single page app. Google started rendering JavaScript when crawling pages in mid-2014, but do Yahoo and Bing also interpret JavaScript when they crawl pages? Do I need to include them in my Prerender.io configuration? 回答1: As of today there is no indication that Bing (which powers Yahoo search) parses and processes JavaScript the same way as Googlebot does. So if

Failing to setup a test environment with grunt, phantomjs and mocha

房东的猫 提交于 2019-12-13 13:29:34
问题 I'm trying to setup a test environment with grunt, phantomjs and mocha using yeoman. The problem is when run the test task I got the following warning: Warning: PhantomJS timed out, possibly due to a missing Mocha run() call. Use --force to continue. But I'm calling mocha.run() in my index.html file. Here it is: <!doctype html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>Mocha Spec Runner</title> <link rel="stylesheet" href="bower