This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const puppeteer = require('puppeteer'); | |
| (async () => { | |
| const browser = await puppeteer.launch(); | |
| const page = await browser.newPage(); | |
| await page.goto('https://techmultitude.com'); | |
| await page.setViewport({width: 320, height: 480}); | |
| await page.waitForNavigation({'waitUntil' : 'networkidle'}); | |
| await page.screenshot({path: 'website.png', fullPage: true}); | |
| await browser.close(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var parseQuery = ( urlStr ) => { | |
| return new URL(urlStr).search.substring(1).split('&').map(i => { let params = {}; let p = i.split('='); params[p[0]] = decodeURIComponent(p[1]); return params }); | |
| } | |
| console.log(parseQuery("paste your url here")); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| await page.setExtraHTTPHeaders({ | |
| 'Accept-Language': 'en-US,en;q=0.9' | |
| }); | |
| await page.setUserAgent('Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <VirtualHost *:80> | |
| ServerName test.localhost | |
| Header always set Access-Control-Allow-Origin "*" | |
| Header always set Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE, PUT" | |
| Header always set Access-Control-Max-Age "1000" | |
| RewriteEngine On | |
| RewriteCond %{HTTP:Connection} Upgrade [NC] | |
| RewriteRule /(.*) ws://localhost:3001/$1 [P,L] | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ProxyRequests Off | |
| ProxyPreserveHost On | |
| <Proxy pos.##REDACTED###.za> | |
| Order deny,allow | |
| Allow from all | |
| </Proxy> | |
| RewriteEngine On | |
| RewriteCond %{HTTP:Connection} Upgrade [NC] | |
| RewriteRule /(.*) ws://localhost:8080/$1 [P,L] | |
| ProxyPass /socket.io http://localhost:8080/socket.io/ retry=0 timeout=5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const puppeteer = require('puppeteer'); | |
| const proxyChain = require('proxy-chain'); | |
| (async() => { | |
| const oldProxyUrl = 'http://bob:password123@proxy.example.com:8000'; | |
| const newProxyUrl = await proxyChain.anonymizeProxy(oldProxyUrl); | |
| // Prints something like "http://127.0.0.1:45678" | |
| console.log(newProxyUrl); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| location = location | |
| ... and a 534 other ways to reload the page with JavaScript | |
| location = location | |
| location = location.href | |
| location = window.location | |
| location = self.location | |
| location = window.location.href | |
| location = self.location.href | |
| location = location['href'] | |
| location = window['location'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| handler = { | |
| get: function(target, property, receiver) { | |
| let targetObj = target[property]; | |
| if(typeof targetObj == "function") { | |
| return (...args) => target[property].apply(target,args) | |
| } else { | |
| return targetObj; | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function loadScript(src) { | |
| return new Promise((resolve, reject) => { | |
| const script = document.createElement('script'); | |
| script.src = src; | |
| script.onload = resolve; | |
| script.onerror = reject; | |
| document.head.appendChild(script); | |
| }); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const puppeteer = require('puppeteer'); | |
| (async () => { | |
| const browser = await puppeteer.launch({headless:false}); | |
| const page = await browser.newPage(); | |
| let url = 'youtube url'; | |
| await page.goto(url); | |
| await page.evaluate(() => { | |
| self.moHandler = { | |
| changesObserver: function (mutation) { | |
| if (mutation.type === 'attributes'){ |