Python Forum
Visiting websites and taking screenshots implicitly?
Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Visiting websites and taking screenshots implicitly?
#1
I wanted to visit some websites via python and take screenshots of the website without opening up the browser. Is this possible? 

I was recommended to look into PhantomJS but the tutorials on the site seem to be mainly in Java.
Is there a module I should look into?

Thank you.
Reply
#2
from selenium import webdriver

browser = webdriver.PhantomJS('/home/metulburr/phantomjs')
browser.get('https://python-forum.io/Thread-Visiting-websites-and-taking-screenshots-implicitly')
browser.save_screenshot('screenshot.png')
browser.quit()
Where the path i give PhantomJS() is the path to my phantomjs

Attached Files

Thumbnail(s)
   
Recommended Tutorials:
Reply
#3
Wow, this was super easy. Thank you.

If I wanted to have more freedom, say for example, just take screenshots of only the pictures on the website, it seems I'm able to do this?

It seems that's what the PhantomJS site is referring to here:

http://phantomjs.org/screen-capture.html ?

Is there a python-version of this documentation? I'm only finding loose tutorials via Google.
Reply
#4
see this post
https://python-forum.io/Thread-selenium-screenshot

You should be searching for "selenium python" code. PhantomJS is what you would be using, but that doesnt change the code at all on selenium. This I believe is the official documentation.
Recommended Tutorials:
Reply
#5
(May-01-2017, 11:41 AM)metulburr Wrote: see this post
https://python-forum.io/Thread-selenium-screenshot

You should be searching for "selenium python" code. PhantomJS is what you would be using, but that doesnt change the code at all on selenium. This I believe is the official documentation.


Your post in the provided link above was very useful. 
I was able to pull out just the chart, via the tag_name('svg')

Thank you!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Help with screenshots for each 'div class' paunshotts 0 326 Feb-05-2024, 10:19 AM
Last Post: paunshotts
  Webscrapping sport betting websites KoinKoin 3 5,338 Nov-08-2023, 03:00 PM
Last Post: LoriBrown
  Taking screenshot ConsistentlyInconsistent 1 1,054 Sep-10-2023, 11:20 PM
Last Post: Larz60+
  Web Scraping Sportsbook Websites Khuber79 17 256,659 Mar-17-2021, 12:06 AM
Last Post: Whitesox1
Thumbs Up Issue facing while scraping the data from different websites in single script. Balamani 1 2,077 Oct-20-2020, 09:56 AM
Last Post: Larz60+
Question Selenium Screenshots store in Database Nuwan16 3 1,956 Oct-05-2020, 02:55 PM
Last Post: Nuwan16
  Can urlopen be blocked by websites? peterjv26 2 3,324 Jul-26-2020, 06:45 PM
Last Post: peterjv26
  Python program to write into websites for you pythonDEV333 3 2,451 Jun-08-2020, 12:06 PM
Last Post: pythonDEV333
  [split] Pytest-html add screenshots help rafiPython1 1 7,927 Apr-30-2020, 07:16 PM
Last Post: Gourav
  Scraping Websites to post on Telegram kobryan 1 2,591 Oct-19-2019, 07:03 AM
Last Post: metulburr

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020