Jump to content
UBot Underground

Browswer Screenshot - Set Browser Size And Maximum Page Length Questions.


Recommended Posts

Hello,

 

The script below does an excellent job of navigating to a list of urls, taking a full page length screenshot, saving it with a unique name, and then saving to a specified folder.

 

I have 2 additional things that I'd like it to do and would appreciate some input:

 

1) Desktop and Mobile screen shots - The script appears to take a screenshot based upon the current size of the window.  In the example screenshot below:
https://www.screencast.com/t/RVzft6Gd7LpY 

test-new-0.png is a screenshot of a responsive website that was generated when I manually narrowed the window before running the script.

test-new-1.png is a screenshot of a facebook page. As you can see it is NOT responsive and is a  full page width image even though the browser was manually narrowed (you really can't see that in my example, but trust me ;) ).

test-new-2.png is a screenshot of a google search result (again while the browser was manually narrowed), and like facebook, it is a full desktop screen width screenshot. 

 

Is there a way to set the browser to take desktop and mobile screenshots (set the browser size)?

 

2) As you can see in the Facebook example, the screenshot is the full length of the facebook page.   Is there a way to set a maximum page depth/length for each screenshot.

ui open file("List of urls",#urls)
set headless browser("On")
allow javascript("Yes")
allow css("Yes")
allow images("Yes")
allow flash("Yes")
comment("Make sure they uploaded a list of urls, let them know if they didn\'t!")
if($is blank(#urls)) {
    then {
        alert("Please load a list of urls first")
        stop script
    }
    else {
    }
}
comment("Make sure your lists and tables get cleared out before each run to avoid problems
if they decide to use the program over and over")
clear list(%urls)
add list to list(%urls,$list from file(#urls),"Delete","Global")
comment("Set the table row number, we will use this in the 
image file name commands below Number starts at 0 because 0 
is the first number counted in programming
so row 0 is the first row and 1 is the second and so on")
set(#row,0,"Global")
comment("List total is the number of items in the list if we loop for the list total
then it will automatically loop for the correct number")
loop($list total(%urls)) {
    comment("Use next list item to get the next item in the list automatically")
    navigate($next list item(%urls),"Wait")
    save browser image("{$special folder("Desktop")}\\BrowserShot-results\\test-new-{#row}.png")
    comment("Increment the row number now so that in the file name will
be sequential for each image")
    increment(#row)
}
set(#save_location,"{$special folder("Desktop")}\\BrowserShot-results","Global")
alert("Screenshots are done {#save_location}")

Any help/insight would be appreciated.

 

Thanks,

Chris

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...