Giter Site home page Giter Site logo

Comments (8)

maaaaz avatar maaaaz commented on July 21, 2024 1

Python 2 compatibility does not have to maintained, particularly for a specific feature.

from webscreenshot.

maaaaz avatar maaaaz commented on July 21, 2024

Hello, try to play with --ajax-max-timeouts.
And take a look at this

from webscreenshot.

mtdeguzis avatar mtdeguzis commented on July 21, 2024

My use case is Icingaweb2 (Icinga2 web front end), the page loads, but the screenshot is taken so quick the alerts are not loaded:
image

It would be nice to have the engine load the page, and allow the scrape request to wait X seconds.

Possibly related:

from webscreenshot.

sbermind avatar sbermind commented on July 21, 2024

Hello, try to play with --ajax-max-timeouts.
And take a look at this

Hello!
--ajax-max-timeouts works only for PhantomJS, isn't it?

I have the same problem. Some pages don't load because screenshots is done too fast. (i'm using -r chromium)
It is good idea to add a request waiting. If you add this function i will be very grateful.
Thank you.

from webscreenshot.

zonicdoe avatar zonicdoe commented on July 21, 2024

I'm working on a fork that will use the Devtools protocol to manage the screenshot process for Chromium based browsers such as Chrome. I've ran into the same issue in the past, specially with those sites that have some sort of WAF protection that is not very agressive, but it requires to wait for at least 5 seconds to render the requested page.
With the aid of the Devtools protocol running the browser in remote debugging mode, some of the PhantomJS exclusive functions can be implemented in Chrome, such as image cropping, screenshot delay, http headers and cookies control, etc, etc. The only caveat I see with this implementation is the use of the "websockets" lib needed to interact with the browser, because it requires python 3, and it will break backwards compatibility with python 2 :(
Do you guys know any websocket library compatible with python 2?

from webscreenshot.

zonicdoe avatar zonicdoe commented on July 21, 2024

Awesome :)

from webscreenshot.

zonicdoe avatar zonicdoe commented on July 21, 2024

Hello @maaaaz .
Here is my suggested approach to implement the Devtools protocol in the script.
It's not complete yet, and there are a lot of tests to run, but it will give you a general idea of where this is going:
Running Chrome / Chromium in remote debugging mode: Line 325
Screenshot function (currently supporting PDF, JPG and PNG formats, image quality for JPG and screenshot delay): Line 765
I'll be implementing other functions from the PhantomJS renderer and then I will start the heavy testing, but for now I will be uploading new changes to the experimental branch.
Regards ;)
Edit:
Added --crop option support: Line 950
Edit:
Added --cookie option support: Line 828
Edit:
Added --header option support: Line 815

from webscreenshot.

MarcoLeder-zz avatar MarcoLeder-zz commented on July 21, 2024

Dear maaaaz

Really looking forward for the implementation of this feature - hopefully you'll be able to add it soon :)

from webscreenshot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.