How to save complete webpage using google puppeteer? - node.js

Is there any way using google puppeteer to control chromium to save the complete webpage? (Manually, I right click some empty space on the page, select "Save as..." in context menu, and then save the page as type "Webpage, Complete")

Related

Launch automatically popup chrome-extension

I would like to know if it would be possible to open the popup window of a chrome-extension when I select a text from a website.
Now when I select a text I store it in the localstorage through chrome.contextMenus.onClicked.addListener((event) and to show the results, I have to go with the mouse and manually open the extension. Let's see if it is possible to automate that action .
Thanks.

How do you click a button in a browser popup window

I'm new to using Watir and have a problem. Within my browser page there is an option to add a note. This brings up a window within the browser which has the following id:
span id="ui-id-2" class="ui-dialog-title">Add Note</span
I can't work out how to use the controls within this window such as the 'Save' button as Watir doesn't seem to recognise either the window or the controls
So if I wanted to use same type of Save button within the main browser it would be fine; I'd just use browser.button(:id=> "Save").click.
Trying to use it within the popup though won't work as Watir can't recognise it within the popup. Any ideas appreciated!

Chrome extension Modal/Popup on click

I want to dynamically generate some buttons on my chrome extension default_popup HTML page and I want on click to open a model in the middle of the screen NOT a new tab, I saw some other extensions having its options like this, and then display some info.
I think the only possibility isto get rid of the defalt_popup and inject all my scripts through the background page straight into the html page.

Save text from specified tags into text file?

I want to copy text from a particular div class, and save it externally, and then click a button, before repeating the process, to copy the content from an online quiz.
Only, the URL does not change, and the content is updated dynamically. I tried an iFrame so I could simulate button presses with jQuery but the content wouldn't load over it, and I'm not sure I could do so with node.JS because the URL is static.
Any suggestions as to how I could do it, whether it be a Chrome extension or just a program?
Thanks

Google Blogger - Refresh page opened in a tab from another tab

Question like this has been asked in SO before, and it seems it is not possible to grab the URLs opened in other tabs.
If you write blogs, then you could have seen the Preview button, which on click opens the blog post in preview mode in a new tab and each time you clicks that button the preview page which was opened previously get refreshed.
May be my question is not constructive, but I was wondering how they are capturing the tab and refreshing the page.
What kind of stuff they are using? If anybody got the knowledge, if you share it would be very helpful.
Update:
Firebugging reveals that the Preview is a button:
Here is what Blogger uses for preview link for my post:
Preview
So what they do is use anchor tag with target attribute of a custom name (previewpost+postID).
When you first click on preview link, no tab will have this custom name, so new tab will be opened. If you click on it again, no new tab will be opened since the tab with that name already exist.
UPDATE:
Using button, this is probably accomplished the same way using javascript window.open(URL,name,specs,replace) method where name specifies the target attribute or the name of the window.

Resources