{"id":10705,"date":"2018-08-09T10:50:07","date_gmt":"2018-08-09T01:50:07","guid":{"rendered":"https:\/\/www.ka-net.org\/blog\/?p=10705"},"modified":"2018-08-09T11:45:08","modified_gmt":"2018-08-09T02:45:08","slug":"%e3%83%98%e3%83%83%e3%83%89%e3%83%ac%e3%82%b9-chrome%e3%82%92seleniumbasic%e3%81%a7%e5%8b%95%e3%81%8b%e3%81%97%e3%81%a6%e3%81%bf%e3%81%be%e3%81%97%e3%81%9f%e3%80%82","status":"publish","type":"post","link":"https:\/\/www.ka-net.org\/blog\/?p=10705","title":{"rendered":"\u30d8\u30c3\u30c9\u30ec\u30b9 Chrome\u3092SeleniumBasic\u3067\u52d5\u304b\u3057\u3066\u307f\u307e\u3057\u305f\u3002"},"content":{"rendered":"<p>Chrome\u304c\u30d8\u30c3\u30c9\u30ec\u30b9\u30e2\u30fc\u30c9\u306b\u5bfe\u5fdc\u3057\u305f\u9803\u3001Selenium\u3067\u64cd\u4f5c\u3057\u305f\u3053\u3068\u304c\u3042\u308b\u306e\u3067\u3059\u304c(\u4e0b\u8a18\u8a18\u4e8b\u53c2\u7167)\u3001<a href=\"https:\/\/florentbr.github.io\/SeleniumBasic\/\" title=\"Seleniumbasic\" target=\"_blank\">SeleniumBasic<\/a>\u304b\u3089\u306e\u64cd\u4f5c\u3082\u8a66\u3057\u3066\u307f\u308b\u3053\u3068\u306b\u3057\u307e\u3059\u3002<\/p>\n<div class=\"cardlink\"><a href=\"https:\/\/www.ka-net.org\/blog\/?p=9048\"><div class=\"cardlink_thumbnail\"><img src='https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/eyecatch-Selenium-120x120.png' alt='\u30d8\u30c3\u30c9\u30ec\u30b9 Chrome\u3092Selenium\u304b\u3089\u52d5\u304b\u3057\u3066\u307f\u307e\u3057\u305f\u3002' width=120 height=120 \/><\/a><\/div><div class=\"cardlink_content\"><span class=\"timestamp\">2017.08.11<\/span><div class=\"cardlink_title\"><a href=\"https:\/\/www.ka-net.org\/blog\/?p=9048\">\u30d8\u30c3\u30c9\u30ec\u30b9 Chrome\u3092Selenium\u304b\u3089\u52d5\u304b\u3057\u3066\u307f\u307e\u3057\u305f\u3002 <\/a><\/div><div class=\"cardlink_excerpt\">\u4e45\u3057\u3076\u308a\u306bSelenium\u306e\u30b5\u30a4\u30c8\u3092\u898b\u3066\u307f\u305f\u3089\u3001\u30d0\u30fc\u30b8\u30e7\u30f33.5.0\u304c\u3061\u3087\u3046\u3069\u51fa\u3066\u3044\u307e\u3057\u305f\u3002\r\n\u6298\u89d2\u306a\u306e\u3067Google Chrome 59\u3067\u642d\u8f09\u3055\u308c\u305f\u30d8\u30c3\u30c9\u30ec\u30b9\u30e2\u30fc\u30c9\u3092\u8a66\u3057\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002\r\n\r\n\u74b0\u5883\r\n\r\n\r\nWindows 10 Enterprise ...<\/div><\/div><div class=\"cardlink_footer\"><\/div><\/div>\n<h4 class=\"style4a\">\u6e96\u5099<\/h4>\n<p>\u4e0b\u8a18\u8a18\u4e8b\u3067\u3082\u66f8\u3044\u3066\u3044\u307e\u3059\u304c\u3001SeleniumBasic\u306b\u540c\u68b1\u3055\u308c\u3066\u3044\u308bWebDriver\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306f\u53e4\u3044\u306e\u3067\u3001SeleniumBasic\u3092\u4f7f\u7528\u3059\u308b\u969b\u306f\u3001\u64cd\u4f5c\u5bfe\u8c61\u3068\u306a\u308b\u30d6\u30e9\u30a6\u30b6\u30fc\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u5408\u3063\u305f\u30d5\u30a1\u30a4\u30eb(<a href=\"http:\/\/chromedriver.chromium.org\/downloads\" title=\"Downloads - ChromeDriver - WebDriver for Chrome\" target=\"_blank\">chromedriver.exe<\/a>)\u306b\u5dee\u3057\u66ff\u3048\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<div class=\"cardlink\"><a href=\"https:\/\/www.ka-net.org\/blog\/?p=10666\"><div class=\"cardlink_thumbnail\"><img src='https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/eyecatch-Selenium-120x120.png' alt='\u30102018\u5e747\u6708\u7248\u3011SeleniumBasic\u3067Microsoft Edge\u3092\u64cd\u4f5c\u3057\u3066\u307f\u307e\u3057\u305f\u3002' width=120 height=120 \/><\/a><\/div><div class=\"cardlink_content\"><span class=\"timestamp\">2018.07.26<\/span><div class=\"cardlink_title\"><a href=\"https:\/\/www.ka-net.org\/blog\/?p=10666\">\u30102018\u5e747\u6708\u7248\u3011SeleniumBasic\u3067Microsoft Edge\u3092\u64cd\u4f5c\u3057\u3066\u307f\u307e\u3057\u305f\u3002 <\/a><\/div><div class=\"cardlink_excerpt\">2\u5e74\u4ee5\u4e0a\u524d\u3001SeleniumBasic\u304cMicrosoft Edge\u306b\u5bfe\u5fdc\u3057\u305f\u9803\u3001\u5f53\u30d6\u30ed\u30b0\u3067\u3082\u53d6\u308a\u4e0a\u3052\u305f\u3053\u3068\u304c\u3042\u308a\u307e\u3057\u305f\u3002\r\n\r\n\r\n\r\nSeleniumBasic\u306e\u66f4\u65b0\u304c2\u5e74\u4ee5\u4e0a\u6b62\u307e\u3063\u3066\u3044\u308b\u3053\u3068\u3082\u3042\u308a\u3001\u3057\u3070\u3089\u304f\u89e6\u3063\u3066\u3044\u306a\u304b\u3063\u305f\u306e\u3067\u3059\u304c\u3001\u6c17\u304c\u5411\u3044\u305f\u306e\u3067\u4e45\u3057\u3076\u308a...<\/div><\/div><div class=\"cardlink_footer\"><\/div><\/div>\n<h4 class=\"style4a\">\u30d8\u30c3\u30c9\u30ec\u30b9 Chrome\u3092SeleniumBasic\u3067\u64cd\u4f5c\u3059\u308bVBA\u30de\u30af\u30ed<\/h4>\n<p><a href=\"https:\/\/www.ka-net.org\/blog\/?p=9048\" title=\"\u30d8\u30c3\u30c9\u30ec\u30b9 Chrome\u3092Selenium\u304b\u3089\u52d5\u304b\u3057\u3066\u307f\u307e\u3057\u305f\u3002 | \u521d\u5fc3\u8005\u5099\u5fd8\u9332\" target=\"_blank\">\u4ee5\u524d\u66f8\u3044\u305f\u8a18\u4e8b<\/a>\u3067\u306f\u3001.Net\u7528\u306eSelenium\u3092\u4f7f\u3044\u300c<span style=\"color: #ff0000; font-weight: bold;\">ChromeOptions<\/span>\u300d\u3067\u30d8\u30c3\u30c9\u30ec\u30b9\u30e2\u30fc\u30c9\u3092\u6307\u5b9a\u3057\u305f\u306e\u3067\u3059\u304c\u3001SeleniumBasic\u3067\u306fChromeOptions\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u306a\u3044\u3088\u3046\u3067\u3059\u3002<\/p>\n<p>\u3069\u3046\u3059\u308c\u3070\u826f\u3044\u306e\u304b\u4e00\u77ac\u8ff7\u3044\u307e\u3057\u305f\u304c\u3001\u300c<span style=\"color: #ff0000; font-weight: bold;\">AddArgument<\/span>\u300d\u3067\u666e\u901a\u306b\u30d8\u30c3\u30c9\u30ec\u30b9\u7528\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u6307\u5b9a\u3059\u308c\u3070\u826f\u3044\u3088\u3046\u3067\u3059\u3002<br \/>\n(\u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u8a73\u7d30\u306b\u3064\u3044\u3066\u306f\u300c<a href=\"https:\/\/developers.google.com\/web\/updates\/2017\/04\/headless-chrome?hl=ja\" title=\"\u30d8\u30c3\u30c9\u30ec\u30b9 Chrome \u3053\u3068\u306f\u3058\u3081  |  Web  |  Google Developers\" target=\"_blank\">\u30d8\u30c3\u30c9\u30ec\u30b9 Chrome \u3053\u3068\u306f\u3058\u3081<\/a>\u300d\u53c2\u7167)<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">Option Explicit\r\n\r\nPublic Sub Sample()\r\n  Dim pdf As Object 'Selenium.PdfFile\r\n  \r\n  With CreateObject(&quot;Selenium.ChromeDriver&quot;)\r\n    '\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4ed8\u3051\u3066Headless Chrome\u3092\u7acb\u3061\u4e0a\u3052\r\n    'https:\/\/developers.google.com\/web\/updates\/2017\/04\/headless-chrome?hl=ja \u53c2\u8003\r\n    .AddArgument &quot;--headless --disable-gpu&quot;\r\n    \r\n    .Start\r\n    .Get &quot;https:\/\/www.yahoo.co.jp\/&quot;\r\n    .FindElementById(&quot;srchtxt&quot;).SendKeys &quot;\u3042\u3044\u3046\u3048\u304a&quot;\r\n    .FindElementById(&quot;srchbtn&quot;).Click\r\n    \r\n    'PDF\u3092\u4f5c\u6210\u3057\u3066\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8\u8cbc\u308a\u4ed8\u3051\r\n    Set pdf = CreateObject(&quot;Selenium.PdfFile&quot;)\r\n    pdf.SetPageSize 210, 297, &quot;mm&quot;\r\n    pdf.SetMargins 5, 5, 5, 15, &quot;mm&quot;\r\n    pdf.AddImage .TakeScreenshot, True\r\n    pdf.SaveAs &quot;C:\\Test\\Screenshot.pdf&quot;\r\n    \r\n    .Quit\r\n  End With\r\n  MsgBox &quot;\u51e6\u7406\u304c\u7d42\u4e86\u3057\u307e\u3057\u305f\u3002&quot;, vbInformation + vbSystemModal\r\nEnd Sub<\/pre>\n<p><a href=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/SeleniumBasic_HeadlessChrome_01.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/SeleniumBasic_HeadlessChrome_01.jpg\" alt=\"\" width=\"632\" height=\"390\" class=\"alignnone size-full wp-image-10706\" srcset=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/SeleniumBasic_HeadlessChrome_01.jpg 632w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/SeleniumBasic_HeadlessChrome_01-300x185.jpg 300w\" sizes=\"auto, (max-width: 632px) 100vw, 632px\" \/><\/a><\/p>\n<p>\u4e0a\u8a18\u30b3\u30fc\u30c9\u306f\u3001<a href=\"https:\/\/www.yahoo.co.jp\/\" title=\"Yahoo! JAPAN\" target=\"_blank\">Yahoo!<\/a>\u3067\u691c\u7d22\u3057\u305f\u7d50\u679c\u306e\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8\u3092\u64ae\u308a\u3001PDF\u30d5\u30a1\u30a4\u30eb\u3068\u3057\u3066\u4fdd\u5b58\u3059\u308b\u51e6\u7406\u3092\u884c\u3044\u307e\u3059\u304c\u3001\u540c\u69d8\u306e\u51e6\u7406\u306fchrome.exe\u306e\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u3082\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">chrome.exe --headless --disable-gpu --print-to-pdf=&quot;C:\\Test\\Screenshot_CMD.pdf&quot; https:\/\/search.yahoo.co.jp\/search?p=%E3%81%82%E3%81%84%E3%81%86%E3%81%88%E3%81%8A<\/pre>\n<div id=\"single_banner_area2\" class=\"clearfix one_banner\">\n<div class=\"single_banner single_banner_left\">\n<script async src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script>\r\n<!-- \u8a18\u4e8b\u4e2d(\u30c7\u30a3\u30b9\u30d7\u30ec\u30a4\u5e83\u544a\u30e6\u30cb\u30c3\u30c8) -->\r\n<ins class=\"adsbygoogle\"\r\n     style=\"display:block\"\r\n     data-ad-client=\"ca-pub-7306936664602087\"\r\n     data-ad-slot=\"5429724765\"\r\n     data-ad-format=\"auto\"\r\n     data-full-width-responsive=\"true\"><\/ins>\r\n<script>\r\n     (adsbygoogle = window.adsbygoogle || []).push({});\r\n<\/script>\n<\/div>\n<div class=\"single_banner single_banner_right\">\n<a href=\"\" target=\"_blank\"><img decoding=\"async\" src=\"\" alt=\"\" title=\"\" \/><\/a>\n<\/div>\n<\/div>\n\n","protected":false},"excerpt":{"rendered":"Chrome\u304c\u30d8\u30c3\u30c9\u30ec\u30b9\u30e2\u30fc\u30c9\u306b\u5bfe\u5fdc\u3057\u305f\u9803\u3001Selenium\u3067\u64cd\u4f5c\u3057\u305f\u3053\u3068\u304c\u3042\u308b\u306e\u3067\u3059\u304c(\u4e0b\u8a18\u8a18\u4e8b\u53c2\u7167)\u3001SeleniumBasic\u304b\u3089\u306e\u64cd\u4f5c\u3082\u8a66\u3057\u3066\u307f\u308b\u3053\u3068\u306b\u3057\u307e\u3059\u3002 \u6e96\u5099 \u4e0b\u8a18\u8a18\u4e8b\u3067\u3082\u66f8\u3044\u3066\u3044\u307e\u3059\u304c\u3001Selenium [&hellip;]","protected":false},"author":1,"featured_media":9039,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"[\u30d8\u30c3\u30c9\u30ec\u30b9 Chrome\u3092SeleniumBasic\u3067\u52d5\u304b\u3057\u3066\u307f\u307e\u3057\u305f]","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[4,48,49,154],"tags":[],"class_list":["post-10705","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-office","category-excel-office","category-word-office","category-selenium"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/eyecatch-Selenium.png","jetpack_shortlink":"https:\/\/wp.me\/p4UZZr-2MF","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/10705","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10705"}],"version-history":[{"count":1,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/10705\/revisions"}],"predecessor-version":[{"id":10707,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/10705\/revisions\/10707"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/media\/9039"}],"wp:attachment":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10705"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10705"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10705"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}