forked from luyishisi/Anti-Anti-Spider
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
2,017 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from selenium import webdriver | ||
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities | ||
import time | ||
|
||
dcap = dict(DesiredCapabilities.PHANTOMJS) | ||
dcap["phantomjs.page.settings.userAgent"] = ( | ||
"Mozilla/5.0 (Linux; Android 5.1.1; Nexus 6 Build/LYZ28E) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.23 Mobile Safari/537.36" | ||
) | ||
dcap["phantomjs.page.settings.userAgent"] = ( | ||
"Mozilla/5.0 (Linux; Android 5.1.1; Nexus 6 Build/LYZ28E) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.23 Mobile Safari/537.36" | ||
) | ||
dcap["phantomjs.page.customHeaders"] = { | ||
"X-Forwarded-For":'110.216.12.194' | ||
} | ||
|
||
#page.driver.headers | ||
|
||
print 'begin' | ||
driver = webdriver.PhantomJS(desired_capabilities=dcap) | ||
|
||
#driver.get("https://www.baidu.com/s?wd=ip") | ||
driver.get("https://httpbin.org/get?show_env=1") | ||
#driver.get("http://lbs.amap.com/getting-started/locate/") | ||
|
||
time.sleep(5) | ||
driver.get_screenshot_as_file('01.png') | ||
print 'end' | ||
|
||
driver.quit() |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[INFO - 2017-01-13T08:01:38.570Z] GhostDriver - Main - running on port 49845 | ||
[INFO - 2017-01-13T08:01:38.895Z] Session [82fd2aa0-d966-11e6-b976-51fe51460522] - page.settings - {"XSSAuditingEnabled":false,"javascriptCanCloseWindows":true,"javascriptCanOpenWindows":true,"javascriptEnabled":true,"loadImages":true,"localToRemoteUrlAccessEnabled":false,"userAgent":"Mozilla/5.0 (Linux; Android 5.1.1; Nexus 6 Build/LYZ28E) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.23 Mobile Safari/537.36","webSecurityEnabled":true} | ||
[INFO - 2017-01-13T08:01:38.895Z] Session [82fd2aa0-d966-11e6-b976-51fe51460522] - page.customHeaders: - {} | ||
[INFO - 2017-01-13T08:01:38.895Z] Session [82fd2aa0-d966-11e6-b976-51fe51460522] - Session.negotiatedCapabilities - {"browserName":"phantomjs","version":"2.1.1","driverName":"ghostdriver","driverVersion":"1.2.0","platform":"mac-10.11 (El Capitan)-64bit","javascriptEnabled":true,"takesScreenshot":true,"handlesAlerts":false,"databaseEnabled":false,"locationContextEnabled":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"cssSelectorsEnabled":true,"webStorageEnabled":false,"rotatable":false,"acceptSslCerts":false,"nativeEvents":true,"proxy":{"proxyType":"direct"},"phantomjs.page.settings.userAgent":"Mozilla/5.0 (Linux; Android 5.1.1; Nexus 6 Build/LYZ28E) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.23 Mobile Safari/537.36"} | ||
[INFO - 2017-01-13T08:01:38.895Z] SessionManagerReqHand - _postNewSessionCommand - New Session Created: 82fd2aa0-d966-11e6-b976-51fe51460522 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
var page = require('webpage').create(); | ||
system = require('system'); | ||
|
||
// console.log(system.args[0]) | ||
// console.log(system.args[1]) | ||
// console.log(system.args[2]) | ||
address = system.args[1]; | ||
|
||
page.settings.userAgent ="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36" | ||
page.customHeaders = { | ||
"X-Forwarded-For": '110.216.12.194' | ||
}; | ||
|
||
page.viewportsize={width:2000,height:2000}; | ||
|
||
page.onResourceReceived = function(response) { | ||
console.log('Response (#' + response.id + ', stage "' + response.stage + '"): ' + JSON.stringify(response)); | ||
}; | ||
|
||
page.open('http://lbs.amap.com/getting-started/locate/', function() { | ||
//page.open('http://ditu.baidu.com/', function() { | ||
setTimeout(function(){ | ||
page.render(address+'.png'); | ||
console.log(address+'.png'); | ||
console.log(page.content); | ||
phantom.exit(); | ||
},5000) | ||
}); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
|
||
import os,re,time,MySQLdb,MySQLdb.cursors,urllib2,random | ||
import requests | ||
for i in range(300,400): | ||
common = 'phantomjs' + ' phantomjs.js ' + str(i) | ||
print time.ctime(),common | ||
str_body = str(os.popen(common).read()) |