phantomjs

meteor-webshot is not working to take a screenshot and save it on the server

为君一笑 提交于 2019-12-11 09:52:58
问题 On the server I would like to take a screenshot of an external link and save it to the server in a folder. I am trying to use the package webshot for meteor: https://github.com/TimHeckel/meteor-webshot But it is not working. I installed the package using mrt add webshot. The package installed successfully. According to this stackoverflow: How to use webshot with meteor I was able to edit the package.js file for webshot to export WEBSHOT variable server side like so: Package.on_use(function

Can't get login with casperjs to work

对着背影说爱祢 提交于 2019-12-11 09:47:31
问题 I scrapped the page https://www.wikifolio.com/de/de/home for a while now with casperjs. Recently it takes a login to see the information on the page and I just can't get it to work. I can't seem to find which item I have to click to get rid of the disclaimer and later to log into the site. 回答1: It's possible with 2 different ways, this will work: var casper = require('casper').create({ verbose: true, logLevel: 'debug', waitTimeout: 5000, userAgent: 'Mozilla/5.0 (X11; Linux x86_64; rv:49.0)

phantomjs not reaching function

試著忘記壹切 提交于 2019-12-11 09:38:51
问题 following on from this , I have rewritten my script but am unable to reach the function where I am performing the scrape of data. As a result my object is null. How can I ensure I reach the function? How can I populate the object? (note I the object and the way to populate it is based on discussion from an earlier post, but please let me know if I am making any error here in the script below) Error Output: ReferenceError: cant find variable: angular (not sure what this means...am ignoring for

How to solve concurrency problems when trying to print the URLs for which there was an alert?

时光怂恿深爱的人放手 提交于 2019-12-11 09:38:45
问题 I am trying to use PhantomJS to loop through a couple of URLs, open the pages and check if there was an alert on any of the pages. I am also printing the URLs of the pages where an alert occurred. The code is as below: var page = require('webpage'); var u = ["http://127.0.0.1/DVWA-1.0.8/vulnerabilities/xss_r/?name=<SCRIPT>alert('XSS');</SCRIPT>", "http://127.0.0.1/DVWA-1.0.8/vulnerabilities/xss_r/?name=abcd"] var url = ""; for(var i = 0; i < u.length; i++) { url = u[i]; var webpage = page

phantom capture https webpage

大憨熊 提交于 2019-12-11 09:15:03
问题 I use phantomjs to capture a https webpage, but the resulting image is a whole black image. How do I fix it or does it mean phantomjs can't capture an https webpage? code like this: var webpage = require('webpage'); var page = webpage.create(); page.open('https://twitter.com/JavaScriptDaily',function(status){ page.render('twitter.jpeg', {format: 'jpeg', quality: '100'}); phantom.exit(); }); 回答1: Render your image in png, it will solve your problem. var webpage = require('webpage'); var page =

PhantomJS executing JavaScript in a popup for data extraction

大憨熊 提交于 2019-12-11 08:55:21
问题 So I have a web page with some photos of people. When you click on a photo of the person the JavaScript is executed and produces a popup with some more detailed information such as a description etc. The link for each photo is as follows: <a href="javascript:void(0)" data="10019" class="seeMore"></a> First I want to start with the basics, of just extracting the description etc. from one single person. So I want to execute the JavaScript above to write the popup window, and when I'm on the

Starting with Phantomjs driver

有些话、适合烂在心里 提交于 2019-12-11 08:48:47
问题 Can anyone suggest me good documentations or steps to start or configure phantomJs driver in java so that i can run my test cases in remote server. 回答1: I run the selenium server in grid mode then connect the phantomjs to it after it is up as it doesn't try to reconnect if it disconnects or isn't fully up ./phantomjs --webdriver=5558 --webdriver-selenium-grid-hub=http://localhost:4444 which will have it listen on port 5558 (for example) but you connect through selenium an it appears as

Selenium with PhantomJS URLError( Works in Windows fails in Ubuntu16.04)

喜欢而已 提交于 2019-12-11 08:41:08
问题 My scraping code works perfectly in my local computer(Windows 8) but fails in Digital Ocean droplet(Ubuntu 16.04)..Always fails on the second loop giving Bad Status Line or URLError..Have already spent a few hours googling this problem ... Setup: PhantomJS 2.1.1 Selenium 2.53.6 Python 2.7 class Elitebet: t1 = time.time() driver = webdriver.PhantomJS() def controller(self): self.driver.get("http://www.elitebetkenya.com/coupon.php?d") element = WebDriverWait(self.driver, 10).until( EC.presence

CasperJS : how to call __doPostBack

混江龙づ霸主 提交于 2019-12-11 08:26:03
问题 I am trying to scrap a page : http://fd1-www.leclercdrive.fr/057701/courses/pgeWMEL009_Courses.aspx#RS284323 But as you can see this link redirect to fd1-www.leclercdrive.fr/057701/courses/pgeWMEL009_Courses.aspx when you first access it. after you click on "fruits et légumes" you can access the page using the url directly So I need to simulate a click on the button "Fruits et légumes" to access the page I want. In the code, it does a dopostback Here is my code that I use with casperj s : var

PhantomJS, Qunit, Grunt testing browser resize widgets

廉价感情. 提交于 2019-12-11 08:25:13
问题 I've created a jQuery UI Widget that resizes a DIV/thing to fill up the browser screen. It all works fine but now I want to create unit tests for testing that it's resizing and keeping to boundaries etc. I'm using Grunt with grunt-contrib-qunit , which uses PhantomJS to do tests but am now unsure how I can test browser resizing at this point as it's not possible via JS to resize a browser. Perhaps PhantomJS provides something that allows me to alter it at runtime? 回答1: Check CasperJS library.