{"id":163,"date":"2021-04-14T07:15:03","date_gmt":"2021-04-13T22:15:03","guid":{"rendered":"http:\/\/tips.yomou.info\/?p=163"},"modified":"2021-04-14T07:15:03","modified_gmt":"2021-04-13T22:15:03","slug":"selenium%e3%81%ae%e5%b0%8e%e5%85%a5%ef%bc%88docker%e5%88%a9%e7%94%a8%ef%bc%89","status":"publish","type":"post","link":"https:\/\/tips.yomou.online\/?p=163","title":{"rendered":"Selenium\u306e\u5c0e\u5165\uff08Docker\u5229\u7528\uff09"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u7d4c\u7def<\/h2>\n\n\n\n<p>ECMWF\u306e\u30b5\u30a4\u30c8\u306e\u7d75\u3092\u81ea\u52d5\u7684\u306b\u53d6\u5f97\u3057\u3066\u6bd4\u8f03\u306b\u4f7f\u3044\u305f\u3044\u3002<\/p>\n\n\n\n<p>\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u304c\u30e9\u30f3\u30c0\u30e0\u306aURL\u306b\u914d\u7f6e\u3055\u308c\u308b\u306e\u3067\u3001ECMWF\u306e\u30a6\u30a7\u30d6\u30da\u30fc\u30b8\u5074\u304b\u3089\u8fbf\u308b\u306e\u304c\u5fc5\u9808\u3002<\/p>\n\n\n\n<p>\u624b\u4f5c\u696d\u3067\u6bce\u56de\u53d6\u5f97\u3059\u308b\u306e\u306f\u3068\u3063\u3066\u3082\u8ca0\u62c5\u3002\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u306e\u51fa\u756a\uff01<\/p>\n\n\n\n<p>ECMWF\u306e\u30b5\u30a4\u30c8\u304cIE\u3067\u52d5\u304b\u306a\u3044\u304b\u3089\u3001Selenium\u306b\u624b\u3092\u51fa\u3059\u304b\u2026\uff08\u6700\u521d\u306f\u3061\u3087\u3063\u3068\u62e1\u5f35\u6a5f\u80fd\u3084\u308d\u3046\u3068\u3057\u305f\uff09<\/p>\n\n\n\n<p>\u74b0\u5883\u69cb\u7bc9\u306b\u591a\u5c11\u624b\u9593\u304c\u304b\u304b\u308b\u3089\u3057\u3044\u304b\u3089\u3001\u3053\u306e\u6a5f\u306bDocker\u3082\u899a\u3048\u3088\u3046\uff08Docker\u3063\u3066\u30eb\u30fc\u30c1\u30f3\u5316\u306b\u5411\u3044\u3066\u3044\u308b\u304b\u3088\u304f\u308f\u304b\u3089\u306a\u3044\u3093\u3060\u3051\u3069\u5927\u4e08\u592b\u304b\u306a\u3041\u2026\u5177\u4f53\u7684\u306a\u4e0d\u5b89\u306f\u969c\u5bb3\u5bfe\u5fdc\u3084\u30aa\u30fc\u30d0\u30fc\u30d8\u30c3\u30c9\u3001\u4f7f\u7528\u6761\u4ef6\u304c\u5909\u308f\u3063\u3061\u3083\u308f\u306a\u3044\u304b\u306a\u3069\uff09<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Docker\u306e\u5c0e\u5165<\/h2>\n\n\n\n<p>\u306a\u306b\u306f\u3068\u3082\u3042\u308c\u307e\u305a\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3057\u3066\u307f\u308b\u3002\u8a00\u308f\u308c\u305f\u901a\u308a\u306bdevice-mapper\u304b\u3089\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u307f\u308b\u3051\u3069\u3001\u3053\u308c\u3063\u3066\u4f55\u3060\u308d\u3046\uff1fdocker\u5c02\u7528\u30e9\u30a4\u30d6\u30e9\u30ea\u307f\u305f\u3044\u306a\u3082\u306e\uff1f\u3068\u601d\u3063\u305f\u3051\u3069\u30b9\u30c8\u30ec\u30fc\u30b8\u30c9\u30e9\u30a4\u30d0\u3068\u3044\u3046\u6c4e\u7528\u306e\u3082\u306e\u3089\u3057\u3044\uff08\u3084\u3063\u3071\u308a\u3088\u304f\u308f\u304b\u3089\u306a\u3044\uff09<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo yum install -y yum-utils device-mapper-persistent-data lvm2<\/code><\/pre>\n\n\n\n<p>\u6b21\u306byum\u306b\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u8ffd\u52a0\u3059\u308b\u3002\u305d\u3057\u3066docker-ce\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3002\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u3044\u3058\u3089\u306a\u304f\u3066\u3082\u30ec\u30dd\u30b8\u30c8\u30ea\u8ffd\u52a0\u3063\u3066\u51fa\u6765\u308b\u3093\u3060\u306d\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo yum-config-manager --add-repo \\\n    https:&#47;&#47;download.docker.com\/linux\/centos\/docker-ce.repo\n$ sudo yum install docker-ce<\/code><\/pre>\n\n\n\n<p>\u5148\u4eba\u306e\u77e5\u6075\u3042\u308a\u304c\u305f\u3084\u3002\u4ee5\u4e0b\u306e\u901a\u308a\u306b\u6253\u3063\u3066docker\u3092\u8d77\u52d5\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo systemctl start docker<\/code><\/pre>\n\n\n\n<p>docker\u306e\u4f7f\u3044\u65b9\u3092\u308d\u304f\u306b\u77e5\u3089\u306a\u3044\u307e\u307e\u3001Selenium\u306edocker\u306e\u5c0e\u5165\u306b\u9032\u3080\u3002\u307e\u3041\u4f55\u3068\u304b\u306a\u308b\u3063\u3057\u3087\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo pip3 install selenium<\/code><\/pre>\n\n\n\n<p>\u8a66\u3057\u306b\u3054\u304f\u7c21\u5358\u306a\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3092\u52d5\u304b\u3057\u3066\u307f\u308b\u3002<\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:100%\">\n<pre class=\"wp-block-code\"><code>from selenium import webdriver\r\n\r\n# Chrome \u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u8a2d\u5b9a\u3059\u308b\r\noptions = webdriver.ChromeOptions()\r\noptions.add_argument('--headless')\r\n\r\n# Selenium Server \u306b\u63a5\u7d9a\u3059\u308b\r\ndriver = webdriver.Remote(\r\n    command_executor='http:\/\/localhost:4444\/wd\/hub',\r\n    desired_capabilities=options.to_capabilities(),\r\n    options=options,\r\n)\r\n\r\n# Selenium \u7d4c\u7531\u3067\u30d6\u30e9\u30a6\u30b6\u3092\u64cd\u4f5c\u3059\u308b\r\ndriver.get('https:\/\/qiita.com')\r\nprint(driver.current_url)\r\n\r\n# \u30d6\u30e9\u30a6\u30b6\u3092\u7d42\u4e86\u3059\u308b\r\ndriver.quit()\r\n<\/code><\/pre>\n\n\n\n<p>\u52d5\u3044\u305f\uff01\u30d8\u30c3\u30c9\u30ec\u30b9\u30e2\u30fc\u30c9\u3067\u52d5\u304b\u3059\u304b\u3089\u4f55\u3084\u3063\u3066\u3044\u308b\u304b\u898b\u3048\u306a\u304f\u3066\u3001\u601d\u3063\u305f\u3088\u308a\u6642\u9593\u304b\u304b\u3063\u305f\u3051\u308c\u3069\u3001\u81ea\u52d5\u51e6\u7406\u3067\u304d\u308b\u306a\u3089\u554f\u984c\u306a\u3044\u304b\u3002<\/p>\n<\/div>\n<\/div>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u53c2\u8003\u6587\u732e<\/h2>\n\n\n\n<p>Docker\u5165\u9580\uff08\u3055\u304f\u3089\u306e\u30ca\u30ec\u30c3\u30b8\uff09 &#8211; <a href=\"https:\/\/knowledge.sakura.ad.jp\/13265\/\">https:\/\/knowledge.sakura.ad.jp\/13265\/<\/a><\/p>\n\n\n\n<p>10\u5206\u3067\u7406\u89e3\u3059\u308b Selenium &#8211; <a href=\"https:\/\/qiita.com\/Chanmoro\/items\/9a3c86bb465c1cce738a\">https:\/\/qiita.com\/Chanmoro\/items\/9a3c86bb465c1cce738a<\/a><\/p>\n\n\n\n<p>CentOS7\u00d7Chrome\u3067\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u74b0\u5883\u3092\u69cb\u7bc9\u3059\u308b\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb &#8211; <a href=\"https:\/\/qiita.com\/sakuraya\/items\/8d415e154ce60a83d63d#\">https:\/\/qiita.com\/sakuraya\/items\/8d415e154ce60a83d63d#<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7d4c\u7def ECMWF\u306e\u30b5\u30a4\u30c8\u306e\u7d75\u3092\u81ea\u52d5\u7684\u306b\u53d6<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-163","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/tips.yomou.online\/index.php?rest_route=\/wp\/v2\/posts\/163","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tips.yomou.online\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tips.yomou.online\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tips.yomou.online\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tips.yomou.online\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=163"}],"version-history":[{"count":1,"href":"https:\/\/tips.yomou.online\/index.php?rest_route=\/wp\/v2\/posts\/163\/revisions"}],"predecessor-version":[{"id":164,"href":"https:\/\/tips.yomou.online\/index.php?rest_route=\/wp\/v2\/posts\/163\/revisions\/164"}],"wp:attachment":[{"href":"https:\/\/tips.yomou.online\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=163"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tips.yomou.online\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=163"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tips.yomou.online\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=163"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}