相关疑难解决方法(0)

当您使用含硒的硒时,网站是否可以检测到?

我一直在用Chromedriver测试Selenium,我注意到有些页面可以检测到你正在使用Selenium,即使根本没有自动化.即使我只是通过Selenium和Xephyr使用chrome手动浏览我经常会得到一个页面,说明检测到可疑活动.我检查了我的用户代理和浏览器指纹,它们与普通的Chrome浏览器完全相同.

当我在普通镀铬中浏览这些网站时,一切正常,但是当我使用Selenium的时候,我已经检测到了.

从理论上讲,chromedriver和chrome应该看起来与任何网络服务器完全相同,但不知怎的,他们可以检测到它.

如果你想要一些测试代码试试这个:

from pyvirtualdisplay import Display
from selenium import webdriver

display = Display(visible=1, size=(1600, 902))
display.start()
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('--disable-extensions')
chrome_options.add_argument('--profile-directory=Default')
chrome_options.add_argument("--incognito")
chrome_options.add_argument("--disable-plugins-discovery");
chrome_options.add_argument("--start-maximized")
driver = webdriver.Chrome(chrome_options=chrome_options)
driver.delete_all_cookies()
driver.set_window_size(800,800)
driver.set_window_position(0,0)
print 'arguments done'
driver.get('http://stubhub.com')
Run Code Online (Sandbox Code Playgroud)

如果您浏览stubhub,您将在一两个请求中被重定向和"阻止".我一直在研究这个,我无法弄清楚他们如何判断用户是否正在使用Selenium.

他们是如何做到的呢?

编辑更新:

我在Firefox中安装了Selenium IDE插件,当我在普通的firefox浏览器中使用附加插件访问stubhub.com时,我被禁止了.

编辑:

当我使用Fiddler来查看来回发送的HTTP请求时,我注意到"假浏览器"的请求通常在响应头中有"无缓存".

编辑:

这样的结果是否有办法检测到我在Javascript的Selenium Webdriver页面中建议无法检测何时使用webdriver.但是这个证据表明不然.

编辑:

该网站将指纹上传到他们的服务器,但我检查了使用chrome时硒的​​指纹与指纹相同.

编辑:

这是他们发送到服务器的指纹有效负载之一

{"appName":"Netscape","platform":"Linuxx86_64","cookies":1,"syslang":"en-US","userlang":"en-US","cpu":"","productSub":"20030107","setTimeout":1,"setInterval":1,"plugins":{"0":"ChromePDFViewer","1":"ShockwaveFlash","2":"WidevineContentDecryptionModule","3":"NativeClient","4":"ChromePDFViewer"},"mimeTypes":{"0":"application/pdf","1":"ShockwaveFlashapplication/x-shockwave-flash","2":"FutureSplashPlayerapplication/futuresplash","3":"WidevineContentDecryptionModuleapplication/x-ppapi-widevine-cdm","4":"NativeClientExecutableapplication/x-nacl","5":"PortableNativeClientExecutableapplication/x-pnacl","6":"PortableDocumentFormatapplication/x-google-chrome-pdf"},"screen":{"width":1600,"height":900,"colorDepth":24},"fonts":{"0":"monospace","1":"DejaVuSerif","2":"Georgia","3":"DejaVuSans","4":"TrebuchetMS","5":"Verdana","6":"AndaleMono","7":"DejaVuSansMono","8":"LiberationMono","9":"NimbusMonoL","10":"CourierNew","11":"Courier"}}
Run Code Online (Sandbox Code Playgroud)

它的硒和铬相同

编辑:

VPN仅供一次使用,但在加载第一页后会被检测到.很明显,正在运行一些javascript来检测Selenium.

javascript python selenium google-chrome selenium-chromedriver

303
推荐指数
21
解决办法
13万
查看次数

Selenium - 等待元素出现、可见和可交互

我有一个 Selenium 脚本(Python),它点击回复按钮使anonemail类出现。anonemail 类出现的时间各不相同。因此,我必须使用 sleep 直到元素出现。

我想等到课程出现而不是使用睡眠。我听说过等待命令,但我不知道如何使用它们。

这是我迄今为止所拥有的:

browser.find_element_by_css_selector(".reply-button").click()
sleep(5)
email=browser.find_element_by_css_selector(".anonemail").get_attribute("value")
Run Code Online (Sandbox Code Playgroud)

python selenium selenium-webdriver webdriverwait expected-condition

37
推荐指数
5
解决办法
6万
查看次数

Linkedin API节流限制

最近我使用Linkedin people-search API开发了一个应用程序.文档说开发人员注册每天有1个lac API调用,但是当我注册了这个API并运行了一个python脚本时,在300次调用之后它会说限制超出限制.有没有人使用Linkedin API面对这样的问题,评论表示赞赏.

提前致谢.

throttling linkedin

6
推荐指数
2
解决办法
1万
查看次数

给定的Geckodriver版本支持哪些Firefox浏览器版本?

我经常更新Firefox和Chrome浏览器,当前版本54.0.1 32位所以要使用哪个版本的Geckodriver.我试过两个版本Geckodriver-v0.18.0 and geckodriver-v0.16.1

为了将来参考,我在哪里可以找到支持的firefox浏览器列表以及各自的geckodriver版本

注意:启动浏览器中没有任何代码更改

以前的代码是使用geckodriver-v0.16.1为较旧的firefox版本现在在更新firefox 54.0.1和Geckodriver-v0.18.0后获得异常:

org.openqa.selenium.firefox.NotConnectedException:45000 ms后无法在端口7055上连接到主机127.0.0.1.Firefox控制台输出:oundUpdates":1,"bootstrap":false,"skinnable":false,"size":3242616,"sourceURI":null,"releaseNotesURI":null,"softDisabled":false,"foreignInstall":true "hasBinaryComponents":假 "strictCompatibility":假, "区域设置":[], "targetApplications":[{ "ID": "{ec8030f7-C20A-464f-9b0e-13a3a9e97384}", "MINVERSION":"1.5 ", "MAXVERSION": "9.9"}], "targetPlatforms":[], "multiprocessCompatible":假 "signedState":0, "看到":真 "依赖性":[], "hasEmbeddedWebExtension":假, "mpcOptedOut":假的, "userPermissions":空}

firefox selenium selenium-firefoxdriver selenium-webdriver geckodriver

4
推荐指数
2
解决办法
2万
查看次数