stealth_browser_automation 1.1.25 → 1.1.30
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/browserfactory.rb +33 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 651806b3656292c2ab94d0d5881306f49ebd0e66
|
4
|
+
data.tar.gz: 70bafc7c768e14e127e76e0898f0103600507a52
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e423e27ee1c42b626f471afe44d56a4c976b7f8ccf22ef7fe9a9a0f72545b08bd2e5a920df0c4b048606f40f87569897ddf67815791294f345f983bf34533143
|
7
|
+
data.tar.gz: f87e94c9d404a3f329614e5a293a17d88a00e88ab5dce020b3b3fa944d84ea84f9d9e78f76af987384ebd2001c754cab0ae18b0303be743ce0528528208d7f21
|
data/lib/browserfactory.rb
CHANGED
@@ -566,31 +566,59 @@ module BlackStack
|
|
566
566
|
end
|
567
567
|
|
568
568
|
elsif @@type == BlackStack::BrowserFactory::TYPE_MIMIC
|
569
|
+
=begin
|
570
|
+
puts ''
|
569
571
|
begin
|
570
|
-
|
571
|
-
|
572
|
+
print 'Close browser?... '
|
573
|
+
if !@@browser.nil?
|
574
|
+
puts 'yes'
|
575
|
+
print 'Close browser... '
|
576
|
+
@@browser.close
|
577
|
+
puts 'done'
|
578
|
+
else
|
579
|
+
puts 'no'
|
580
|
+
end
|
581
|
+
rescue => e
|
582
|
+
puts "error: #{e.to_s}"
|
572
583
|
end
|
584
|
+
=end
|
573
585
|
=begin
|
574
586
|
begin
|
575
587
|
# TODO: entender porque debo hacer esta llamada a start para que el perfil se cierre cuando ya estaba iniciado
|
576
|
-
|
588
|
+
puts ''
|
589
|
+
print 'Close browser?... '
|
590
|
+
if !@@profile_name.nil?
|
591
|
+
puts 'yes'
|
592
|
+
print 'Close browser... '
|
593
|
+
BlackStack::BrowserFactory.mimic(@@profile_name)
|
594
|
+
puts 'done'
|
595
|
+
print 'Close browser (2)... '
|
596
|
+
@@browser.close
|
597
|
+
puts 'done'
|
598
|
+
else
|
599
|
+
puts 'no'
|
600
|
+
end
|
577
601
|
rescue
|
578
602
|
# nothing here
|
579
603
|
end
|
580
604
|
=end
|
605
|
+
|
581
606
|
i = 0
|
582
607
|
max = 3
|
583
608
|
success = false
|
584
609
|
while i<max && !success
|
585
610
|
i+=1
|
586
|
-
|
611
|
+
url = "http://127.0.0.1:#{BlackStack::StealthBrowserAutomation::Multilogin::mla_local_port}/api/v1/profile/stop?profileId=#{@@profile_name}"
|
612
|
+
print "Api Call ##{i.to_s} to: #{url}... "
|
613
|
+
sleep(50000)
|
587
614
|
uri = URI.parse(url)
|
588
615
|
body = Net::HTTP.get(uri)
|
589
616
|
res = JSON.parse(body)
|
590
617
|
success = true if res['status'].to_s == 'OK'
|
618
|
+
puts "response: #{res['status'].to_s}"
|
591
619
|
end # while i<max
|
592
620
|
raise "Error requesting Mimic to stop (tried #{i.to_s} times)" if !success
|
593
|
-
|
621
|
+
|
594
622
|
else
|
595
623
|
raise 'Cannot destroy browser due unknown browser type'
|
596
624
|
end
|