stealth_browser_automation 1.1.34 → 1.2.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/baseproxy.rb +25 -1
- data/lib/browserfactory.rb +560 -188
- data/lib/proxy.rb +16 -2
- data/lib/stealth_browser_automation.rb +332 -23
- metadata +66 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e0724c65c5e9b2ba3cac47a2c1dc03eec05feb7
|
4
|
+
data.tar.gz: a3219482f992c116ec77cd886be6396e093a7e8c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30482c1c81718f78a70dd2861c56c4ca11dad27cfb2c77aa6b9a81a19401f4be6d9572d2d115ff3825a7b105f73aa16c09bce43d3245f2dfaa2d4beab024be85
|
7
|
+
data.tar.gz: 24bb6b8a536929c277d84eee07703df2612cc96e5d16204832019e7b70538e53e677df7eb768427260bb4a186ab8a030ad370f7148a06c28c66e0d21e395a05e
|
data/lib/baseproxy.rb
CHANGED
@@ -1,7 +1,31 @@
|
|
1
1
|
module BlackStack
|
2
2
|
|
3
3
|
module BaseProxy
|
4
|
-
|
4
|
+
|
5
|
+
##
|
6
|
+
# creates new connection to google.com using +Faraday+ lib. Uses CGI::Cookie class
|
7
|
+
# to parse the cookie returned in the response. It then checks for the presense of
|
8
|
+
# "NID" cookie set by Google. If the cookie exists, proxy server is working just fine.
|
9
|
+
#
|
10
|
+
# references:
|
11
|
+
# - https://github.com/apoorvparijat/proxy-test
|
12
|
+
# - https://github.com/lostisland/faraday
|
13
|
+
#
|
14
|
+
def self.test(proxy_str)
|
15
|
+
begin
|
16
|
+
f = Faraday.new(:proxy => { :uri => "http://" + proxy_str})
|
17
|
+
response = f.get "http://www.google.com"
|
18
|
+
cookie = CGI::Cookie.parse(response.headers["set-cookie"])
|
19
|
+
if(cookie["NID"].empty?)
|
20
|
+
raise "#{proxy_str} is NOT working."
|
21
|
+
else
|
22
|
+
return true
|
23
|
+
end
|
24
|
+
rescue
|
25
|
+
raise "Connection to #{proxy_str} timed out"
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
5
29
|
#
|
6
30
|
def chrome_switches
|
7
31
|
return ["--proxy-server=#{self.ip}:#{self.port}","--proxy-user-and-password=#{self.user}:#{self.password}"]
|