谷歌浏览器

【爬虫】Selenium+chrome

陌路散爱 提交于 2019-12-03 02:06:27
一、下载对应chrome版本的webdriver https://npm.taobao.org/mirrors/chromedriver 二、pom <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-java</artifactId> <version>3.141.59</version> </dependency> 三、初始化selenium System.setProperty("webdriver.chrome.driver",driverPath+"/chromedriver.exe"); ChromeOptions chromeOptions=new ChromeOptions(); //设置 chrome 的无头模式 chromeOptions.setHeadless(Boolean.TRUE); //TRUE为无头模式 chromeOptions.addArguments("--disable-gpu"//禁止使用gpu ,"--blink-settings=imagesEnabled=false"//禁止加载图片 ,"--user-agent=Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36

Chrome extension: sendMessage from background to content script doesn&#039;t work

匿名 (未验证) 提交于 2019-12-03 02:03:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I know that question has been repeatedly asked in different ways, but I tried to go through all the answers (hopefully I didn't miss anyone) and none of them worked for me. Here is my extension's code: manifest: { "name": "test", "version": "1.1", "background": { "scripts": ["contextMenus.js"] }, "permissions": ["tabs", " ", "contextMenus"], "content_scripts" : [ { "matches" : [ "http://*/*" ], "js": ["jquery-1.8.3.js", "jquery-ui.js"], "css": [ "jquery-ui.css" ], "js": ["openDialog.js"] } ], "manifest_version": 2 } contextMenus.js function

To open settings page of chrome browser in android programmatically?

匿名 (未验证) 提交于 2019-12-03 02:03:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am building an android application in which i need to open settings page of chrome browser. I have researched a lot but didn't found any satisfactory result.I have used intent for default browser but that was not working in case of chrome browser. Does anyone has any idea about this ? thankyou in advance ! 回答1: Chrome does not appear to export that activity, so it cannot be started by third-party apps. Even if they did, that behavior could easily vary from version to version of Chrome for Android. Google does not document or support access

IE and Chrome don't fire a mouseover event for &lt;option&gt; elements

匿名 (未验证) 提交于 2019-12-03 02:03:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: My code only works in Firefox. Why is this? HTML: one two three Javascript: $ ( function () { $ ( document ). on ( "mouseover" , "#selecter option" , function (){ alert ( 1 ) }); }); I'm curious why IE and chrome don't fire a mouseover event. See this JSFiddle: http://jsfiddle.net/yT6Y5/72/ (Works perfectly in Firefox.) How can I get IE and Chrome to fire a mouseover event? 回答1: The problem is that browsers render dropdowns differently. Chrome is rendering it not as an HTML component but as a native GUI one. That can't have hover

Google Chrome - How to compile Google Chrome in Windows?

匿名 (未验证) 提交于 2019-12-03 01:58:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Documentation mentioned to compile i have to follow this instruction for Windows: http://www.chromium.org/developers/how-tos/build-instructions-windows So i did all the steps, but the following is failing how can i resolve it? C:\tpt\depot_tools>mkdir out\Debug C:\tpt\depot_tools>ninja -C out\Debug chrome ninja: error: loading 'build.ninja': Het systeem kan het opgegeven bestand niet vinden. ninja: Entering directory `out\Debug' 回答1: DONE. Windows 8.1 Pro 64-bit. Visual Studio 2013 Community edition Install git https://git-scm.com/download

Selenium: chrome driver makes screenshot just of visible part of page

匿名 (未验证) 提交于 2019-12-03 01:57:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I need to do screenshot of full page using chrome driver, but it makes it partly. File screenshotFile = (( TakesScreenshot ) driver ). getScreenshotAs ( OutputType . FILE ); The screenshot looks as visible rectangle with correct information and big black area below. 回答1: This is a known bug: https://code.google.com/p/chromedriver/issues/detail?id=294 (Only for Chrome driver, firefox driver works fine) 回答2: Might worth trying to use this library: https://www.assertthat.com/posts/selenium_shutterbug_make_custom_screenshots_with

Native Messaging Chrome

匿名 (未验证) 提交于 2019-12-03 01:57:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to get Native Messaging between my chrome extension and my c# application. The javascript works fine, but I am getting this error: Error when communicating with the native messaging host. The application does get launched along with the extension, as I saw from Task Manager. Here is my c# code. private static string OpenStandardStreamIn() { //// We need to read first 4 bytes for length information Stream stdin = Console.OpenStandardInput(); int length = 0; byte[] bytes = new byte[4]; stdin.Read(bytes, 0, 4); length = System

【MAC】安装chrome浏览器

假如想象 提交于 2019-12-03 01:51:17
step1:下载dmg安装包    chrome下载地址   点击【下载Chrome】 step2:安装chrome   下载好googlechrome.dmg文件后,像其它程序一样安装就可以了   打开访达-->前往-->应用程序   chrome已经安装好了   双击打开就好 来源: https://www.cnblogs.com/kaerxifa/p/11770205.html

org.openqa.selenium.WebDriverException: unknown error: call function result missing 'value'

匿名 (未验证) 提交于 2019-12-03 01:49:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 选择语言 中文(简体) 日语 英语 中文(繁体) 由 翻译 强力驱动 问题: Sendkeys not working. Please help me to resolve this.. WebElement username = driver . findElement ( By . xpath ( "//*[@id='username']" )); username . sendKeys ( "123456" ); Console: Exception in thread "main" org . openqa . selenium . WebDriverException : unknown error : call function result missing 'value' ( Session info : chrome = 65.0 . 3325.31 ) ( Driver info : chromedriver = 2.33 . 506120 ( e3e53437346286c0bc2d2dc9aa4915ba81d9023f ), platform = Windows NT 6.1 . 7601 SP1 x86 ) ( WARNING : The server did

Chrome禁用隐藏www和m

╄→尐↘猪︶ㄣ 提交于 2019-12-03 01:47:08
解决方案 打开 chrome://flags 启动控制台输入并执行以下内容 [ 'omnibox-ui-hide-steady-state-url-path-query-and-ref', 'omnibox-ui-hide-steady-state-url-scheme', 'omnibox-ui-hide-steady-state-url-trivial-subdomains' ].forEach(function(f) { chrome.send('enableExperimentalFeature', [f + '@2', 'true']); }) 来源: https://www.cnblogs.com/zhuxiaoxi/p/11769996.html