{"id":13098,"date":"2020-11-27T19:09:22","date_gmt":"2020-11-27T10:09:22","guid":{"rendered":"https:\/\/itport.cloud\/?p=13098"},"modified":"2020-11-27T19:09:22","modified_gmt":"2020-11-27T10:09:22","slug":"post-13098","status":"publish","type":"post","link":"https:\/\/itport.cloud\/?p=13098","title":{"rendered":"Selenium\u3092\u4f7f\u3063\u3066Google\u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u30ed\u30b0\u30a4\u30f3"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"e79baee6aca1-1\">\u76ee\u6b21<\/h2>\n\n\n\n<p><a href=\"#topic1\">\u306f\u3058\u3081\u306b<\/a><br><a href=\"#topic2\">\u958b\u767a\u8005\u30c4\u30fc\u30eb\u3092\u4f7f\u3063\u3066\u8981\u7d20\u3092\u7279\u5b9a<\/a> <br><a href=\"#topic3\">\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u4f5c\u6210<\/a><br><a href=\"#topic4\">\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0<\/a><br><a href=\"#topic5\">\u7d42\u308f\u308a<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"topic1\">\u306f\u3058\u3081\u306b<\/h2>\n\n\n\n<p>\u6700\u8fd1C#\u3067Selenium\u3092\u4f7f\u3063\u3066\u30d6\u30e9\u30a6\u30b6\u306e\u81ea\u52d5\u64cd\u4f5c\u3092\u3084\u3063\u3066\u307f\u305f\u306e\u3067\u3001\u305d\u306e\u5185\u5bb9\u3092\u8a18\u4e8b\u306b\u3057\u3088\u3046\u3068\u601d\u3044\u307e\u3059\u3002<br>\u3053\u306e\u8a18\u4e8b\u3067\u306e\u76ee\u6a19\u306f\u300c\u30d6\u30e9\u30a6\u30b6\u306e\u7acb\u3061\u4e0a\u3052\uff5eGoogle\u30a2\u30ab\u30a6\u30f3\u30c8\u3067\u30ed\u30b0\u30a4\u30f3\u3059\u308b\u307e\u3067\u3092\u81ea\u52d5\u5316\u3057\u3066\u307f\u308b\u300d\u3067\u3059\u3002<br><br>\u74b0\u5883<br>Windows10<br>Visual Studio 2019 (C#)<br>Google Chrome<br>Selenium WebDriver<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"topic2\">\u958b\u767a\u8005\u30c4\u30fc\u30eb\u3092\u4f7f\u3063\u3066\u8981\u7d20\u3092\u7279\u5b9a<\/h2>\n\n\n\n<p>\u4eca\u56de\u306eGoogle\u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u30ed\u30b0\u30a4\u30f3\u306e\u6d41\u308c\u306f<br>\u3000\u30ed\u30b0\u30a4\u30f3\u30da\u30fc\u30b8\u2192\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u5165\u529b\u2192\u30d1\u30b9\u30ef\u30fc\u30c9\u5165\u529b\u2192\u30ed\u30b0\u30a4\u30f3<br>\u306e\u9806\u306b\u884c\u3044\u307e\u3059\u3002 <br><br>\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u884c\u3046\u64cd\u4f5c\u3092\u6574\u7406\u3059\u308b\u3068<br>\u30fb\u30ed\u30b0\u30a4\u30f3\u30da\u30fc\u30b8\u3078<strong>\u9077\u79fb<\/strong>\u3059\u308b<br>\u30fb\u300c\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u300d\u3092<strong>\u5165\u529b<\/strong>\u3057\u3066<strong>\u30af\u30ea\u30c3\u30af<\/strong>\u3059\u308b<br>\u30fb\u300c\u30d1\u30b9\u30ef\u30fc\u30c9\u300d\u3092<strong>\u5165\u529b<\/strong>\u3057\u3066<strong>\u30af\u30ea\u30c3\u30af<\/strong>\u3059\u308b<br>\u3067\u3059\u3002<br>\u592a\u5b57\u306f\u52d5\u4f5c\u3092\u8868\u3057\u3066\u3044\u308b\u3064\u3082\u308a\u3067\u3001\u305d\u306e\u52d5\u4f5c\u306e\u5bfe\u8c61\u3068\u306a\u308b\u9805\u76ee\u3092\u9375\u62ec\u5f27\u3067\u56f2\u3063\u3066\u3044\u307e\u3059\u3002<br>\u52d5\u4f5c\u306b\u3064\u3044\u3066\u306f\u884c\u3046\u3053\u3068\u304c\u6c7a\u307e\u3063\u3066\u3044\u308c\u3070\u66f8\u304d\u65b9\u306f\u6c7a\u307e\u3063\u3066\u3044\u307e\u3059\u304c\u3001\u52d5\u4f5c\u306e\u5bfe\u8c61\u306f\u81ea\u5206\u3067\u8abf\u67fb\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<br>\u305d\u306e\u305f\u3081\u958b\u767a\u8005\u30c4\u30fc\u30eb\u3068\u547c\u3070\u308c\u308b\u3082\u306e\u3092\u4f7f\u3063\u3066\u9375\u62ec\u5f27\u306e\u9805\u76ee\u3092\u8abf\u3079\u3066\u3044\u304d\u307e\u3059\u3002<br><br>\u307e\u305aGoogle\u30a2\u30ab\u30a6\u30f3\u30c8\u3067\u30ed\u30b0\u30a4\u30f3\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u306f\u3044\u3063\u305f\u3093\u30ed\u30b0\u30a2\u30a6\u30c8\u3057\u3066\u3001\u4ee5\u4e0b\u306eURL\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<br><a href=\"https:\/\/www.google.com\/accounts\/Login?hl=ja\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (\u65b0\u3057\u3044\u30bf\u30d6\u3067\u958b\u304f)\">https:\/\/www.google.com\/accounts\/Login?hl=ja<\/a><\/p>\n\n\n\n<p>\u305d\u3046\u3059\u308b\u3068\u4eca\u307e\u3067\u30ed\u30b0\u30a4\u30f3\u3057\u305f\u30ed\u30b0\u30a4\u30f3\u30a2\u30ab\u30a6\u30f3\u30c8\u304c\u4e00\u89a7\u3067\u8868\u793a\u3055\u308c\u308b\u306e\u3067\u3001\u300c\u5225\u306e\u30a2\u30ab\u30a6\u30f3\u30c8\u3092\u4f7f\u7528\u300d\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<br>\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u5165\u529b\u3059\u308b\u753b\u9762\u304c\u8868\u793a\u3055\u308c\u305f\u3089\u30ad\u30fc\u30dc\u30fc\u30c9\u306eF12\u3092\u62bc\u3057\u307e\u3059\u3002<br>\u305d\u3046\u3059\u308b\u3068\u958b\u767a\u8005\u30c4\u30fc\u30eb\u3068\u547c\u3070\u308c\u308b\u30a6\u30a3\u30f3\u30c9\u30a6\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/itport.cloud\/wp-content\/uploads\/2020\/11\/2020-11-20_09h17_51.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"522\" src=\"https:\/\/itport.cloud\/wp-content\/uploads\/2020\/11\/2020-11-20_09h17_51-1024x522.png\" alt=\"\" class=\"wp-image-13102\" srcset=\"https:\/\/itport.cloud\/wp-content\/uploads\/2020\/11\/2020-11-20_09h17_51-1024x522.png 1024w, https:\/\/itport.cloud\/wp-content\/uploads\/2020\/11\/2020-11-20_09h17_51-300x153.png 300w, https:\/\/itport.cloud\/wp-content\/uploads\/2020\/11\/2020-11-20_09h17_51-768x392.png 768w, https:\/\/itport.cloud\/wp-content\/uploads\/2020\/11\/2020-11-20_09h17_51-450x229.png 450w, https:\/\/itport.cloud\/wp-content\/uploads\/2020\/11\/2020-11-20_09h17_51-900x459.png 900w, https:\/\/itport.cloud\/wp-content\/uploads\/2020\/11\/2020-11-20_09h17_51.png 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p>\u3053\u306e\u958b\u767a\u8005\u30c4\u30fc\u30eb\u3092\u4f7f\u3063\u3066\u5fc5\u8981\u306aHTML\u30bf\u30b0\u3092\u8abf\u3079\u3066\u3044\u304d\u307e\u3059\u3002<br><\/p>\n\n\n\n<p>\u30ed\u30b0\u30a4\u30f3\u30da\u30fc\u30b8\u3078\u9077\u79fb\u5f8c\u306b\u884c\u3046\u64cd\u4f5c\u306f<br>\u3000\u300c\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u300d\u3092<strong>\u5165\u529b<\/strong>\u3057\u3066<strong>\u30af\u30ea\u30c3\u30af<\/strong>\u3059\u308b <br>\u306a\u306e\u3067\u3001 <br>\u300c\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u300d\u306e\u5165\u529b\u6b04\u306eHTML\u30bf\u30b0\u3092\u8abf\u3079\u307e\u3059\u3002 <br><br>\u958b\u767a\u8005\u30c4\u30fc\u30eb\u306e\u5de6\u4e0a\u306b\u3042\u308b\u56db\u89d2\u3068\u30de\u30a6\u30b9\u30dd\u30a4\u30f3\u30bf\u2015\u306e\u30a2\u30a4\u30b3\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<br>\u305d\u3046\u3059\u308b\u3068\u30d6\u30e9\u30a6\u30b6\u4e0a\u3067\u30de\u30a6\u30b9\u3092\u5408\u308f\u305b\u305f\u7b87\u6240\u306bHTML\u60c5\u5831\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/itport.cloud\/wp-content\/uploads\/2020\/11\/2020-11-20_10h45_16.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"522\" src=\"https:\/\/itport.cloud\/wp-content\/uploads\/2020\/11\/2020-11-20_10h45_16-1024x522.png\" alt=\"\" class=\"wp-image-13103\" srcset=\"https:\/\/itport.cloud\/wp-content\/uploads\/2020\/11\/2020-11-20_10h45_16-1024x522.png 1024w, https:\/\/itport.cloud\/wp-content\/uploads\/2020\/11\/2020-11-20_10h45_16-300x153.png 300w, https:\/\/itport.cloud\/wp-content\/uploads\/2020\/11\/2020-11-20_10h45_16-768x392.png 768w, https:\/\/itport.cloud\/wp-content\/uploads\/2020\/11\/2020-11-20_10h45_16-450x229.png 450w, https:\/\/itport.cloud\/wp-content\/uploads\/2020\/11\/2020-11-20_10h45_16-900x459.png 900w, https:\/\/itport.cloud\/wp-content\/uploads\/2020\/11\/2020-11-20_10h45_16.png 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p><br>\u3053\u306e\u72b6\u614b\u3067\u300c\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u300d\u306e\u5165\u529b\u6b04\u306b\u30de\u30a6\u30b9\u3092\u5408\u308f\u305b\u3001\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<br>\u305d\u3046\u3059\u308b\u3068\u958b\u767a\u8005\u30c4\u30fc\u30eb\u306e\u30a6\u30a3\u30f3\u30c9\u30a6\u306e\u4e2d\u304c\u79fb\u52d5\u3057\u3001\u300c\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u300d\u306e\u5165\u529b\u6b04\u306eHTML\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<br>\u3053\u3053\u3067\u53d6\u5f97\u3067\u304d\u308bHTML\u306f\u4ee5\u4e0b\u3067\u3059\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: xml; title: ; notranslate\" title=\"\">\n<input type=\"email\" class=\"whsOnd zHQkBf\" jsname=\"YPqjbf\" autocomplete=\"username\" spellcheck=\"false\" tabindex=\"0\" aria-label=\"\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u307e\u305f\u306f\u96fb\u8a71\u756a\u53f7\" name=\"identifier\" value=\"\" autocapitalize=\"none\" id=\"identifierId\" dir=\"ltr\" data-initial-dir=\"ltr\" data-initial-value=\"\">\n<\/pre><\/div>\n\n\n<p>\u6b21\u306e\u64cd\u4f5c\u306f<br>\u3000\u300c\u30d1\u30b9\u30ef\u30fc\u30c9\u300d\u3092<strong>\u5165\u529b<\/strong>\u3057\u3066<strong>\u30af\u30ea\u30c3\u30af<\/strong>\u3059\u308b<br>\u306a\u306e\u3067\u3001<br>\u300c\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u300d\u3092\u5165\u529b\u3057\u3066\u300c\u6b21\u3078\u300d\u3092\u30af\u30ea\u30c3\u30af\u3057\u3001\u300c\u30d1\u30b9\u30ef\u30fc\u30c9\u300d\u306e\u5165\u529b\u6b04\u3092\u8868\u793a\u3057\u307e\u3059\u3002<br>\u305d\u3046\u3057\u305f\u3089\u5148\u307b\u3069\u3068\u540c\u3058\u4f5c\u696d\u3092\u3059\u308b\u3068\u4ee5\u4e0b\u306eHTML\u304c\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: xml; title: ; notranslate\" title=\"\">\n<input type=\"password\" class=\"whsOnd zHQkBf\" jsname=\"YPqjbf\" autocomplete=\"current-password\" spellcheck=\"false\" tabindex=\"0\" aria-label=\"\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u5165\u529b\" name=\"password\" autocapitalize=\"off\" dir=\"ltr\" data-initial-dir=\"ltr\" data-initial-value=\"\">\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"topic3\">\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u4f5c\u6210<\/h2>\n\n\n\n<p>\u30da\u30fc\u30b8\u306eURL\u3068\u5bfe\u8c61\u3068\u306a\u308b\u8981\u7d20\u304c\u898b\u3064\u304b\u3063\u305f\u306e\u3067\u3001\u3053\u308c\u304b\u3089\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3092\u59cb\u3081\u3066\u3044\u304d\u307e\u3059\u3002<br>\u307e\u305aVisual Studio\u3092\u8d77\u52d5\u3057\u3066\u300c\u65b0\u3057\u3044\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u4f5c\u6210\u300d\u2192\u300c\u30b3\u30f3\u30bd\u30fc\u30eb\u30a2\u30d7\u30ea\uff08.Net Core\uff09\u300d\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<br>\u6b21\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u540d\u3084\u5834\u6240\u306f\u4efb\u610f\u3067\u5165\u529b\u3044\u305f\u3060\u3044\u3066\u300c\u4f5c\u6210\u300d\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<br>\u305d\u3046\u3059\u308b\u3068\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u304c\u4f5c\u6210\u3055\u308c\u3001\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u753b\u9762\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<br><br>\u6b21\u306bSelenium\u3092\u4f7f\u3046\u305f\u3081\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3044\u304d\u307e\u3059\u3002<br>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3068\u3044\u3063\u3066\u3082Visual Studio\u4e0a\u3067\u5b8c\u7d50\u3059\u308b\u306e\u3067\u3001\u30d6\u30e9\u30a6\u30b6\u3067\u3042\u308b\u30da\u30fc\u30b8\u306b\u884c\u3063\u3066\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u306e\u3088\u3046\u306a\u3053\u3068\u306f\u4e0d\u8981\u3067\u3059\u3002<br>\u30bd\u30ea\u30e5\u30fc\u30b7\u30e7\u30f3\u30a8\u30af\u30b9\u30d7\u30ed\u30fc\u30e9\u306e\u4e2d\u306b\u3042\u308b\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u53f3\u30af\u30ea\u30c3\u30af\u2192\u300cNuget\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u7ba1\u7406\u300d\u3092\u30af\u30ea\u30c3\u30af\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/itport.cloud\/wp-content\/uploads\/2020\/11\/2020-11-20_10h47_10-1.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"553\" src=\"https:\/\/itport.cloud\/wp-content\/uploads\/2020\/11\/2020-11-20_10h47_10-1-1024x553.png\" alt=\"\" class=\"wp-image-13106\" srcset=\"https:\/\/itport.cloud\/wp-content\/uploads\/2020\/11\/2020-11-20_10h47_10-1-1024x553.png 1024w, https:\/\/itport.cloud\/wp-content\/uploads\/2020\/11\/2020-11-20_10h47_10-1-300x162.png 300w, https:\/\/itport.cloud\/wp-content\/uploads\/2020\/11\/2020-11-20_10h47_10-1-768x415.png 768w, https:\/\/itport.cloud\/wp-content\/uploads\/2020\/11\/2020-11-20_10h47_10-1-450x243.png 450w, https:\/\/itport.cloud\/wp-content\/uploads\/2020\/11\/2020-11-20_10h47_10-1-900x486.png 900w, https:\/\/itport.cloud\/wp-content\/uploads\/2020\/11\/2020-11-20_10h47_10-1.png 1366w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p><br>\u305d\u3046\u3059\u308b\u3068Nuget\u7d4c\u7531\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u306e\u3067\u3001\u300c\u53c2\u7167\u300d\u30bf\u30d6\u3092\u30af\u30ea\u30c3\u30af\u2192\u691c\u7d22\u7a93\u306b\u300cSelenium\u300d\u3068\u5165\u308c\u3066\u300cSelenium.WebDriver\u300d\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<br>\u6b21\u306b\u300cSelenium Chrome\u300d\u3068\u5165\u308c\u3066\u300c Selenium.Chrome.WebDriver\u300d\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"topic4\">\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0<\/h2>\n\n\n\n<p>\u3067\u306f\u5b9f\u969b\u306e\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u306b\u79fb\u308a\u307e\u3059\u3002<br>Program.cs\u3092\u4e0b\u8a18\u306e\u3088\u3046\u306b\u4fee\u6b63\u3057\u307e\u3059\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\nusing System;\nusing OpenQA.Selenium;\nusing OpenQA.Selenium.Chrome;\nusing OpenQA.Selenium.Support.UI;\n\nnamespace ConsoleApp6\n{\n    class Program\n    {\n        static void Main(string&#x5B;] args)\n        {\n            string mailAddress = \"\u81ea\u5206\u306e\u30ed\u30b0\u30a4\u30f3\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u3053\u3053\u306b\u5165\u529b\";\n            string password = \"\u81ea\u5206\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u3053\u3053\u306b\u5165\u529b\";\n\n            \/\/ Selenium\u304c\u64cd\u4f5c\u3059\u308bWebDriver\u3092\u5ba3\u8a00\n            var options = new ChromeOptions();\n            IWebDriver driver = new ChromeDriver(options);\n\n            \/\/ Google\u30ed\u30b0\u30a4\u30f3\u753b\u9762\u3078\n            driver.Url = \"https:\/\/www.google.com\/accounts?hl=ja-JP\";\n\n            \/\/ \u8981\u7d20\u304c\u898b\u3064\u304b\u308b\u307e\u3067\u5f85\u6a5f\u3059\u308b\u305f\u3081\u306e\u6e96\u5099\n            var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(30));\n\n\n            \/\/ \u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u306e\u5165\u529b\u6b04\u3092\u63a2\u3059\n            var mailAddressElement = wait.Until( drv => drv.FindElement( By.XPath(\"\/\/input&#x5B;@id='identifierId']\") ) );\n\n            \/\/ \u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u5165\u529b\n            mailAddressElement.SendKeys(mailAddress);\n            mailAddressElement.SendKeys(Keys.Enter);\n\n\n            \/\/ \u753b\u9762\u304c\u5909\u308f\u308b\u307e\u3067\u6642\u9593\u304c\u304b\u304b\u308b\u306e\u3067\u30012000\u30df\u30ea\u79d2\uff08\uff1d2\u79d2)\u5f85\u3061\n            System.Threading.Thread.Sleep(2000);\n\n\n            \/\/ \u30d1\u30b9\u30ef\u30fc\u30c9\u306e\u5165\u529b\u6b04\u3092\u63a2\u3059\n            var passwordElement = wait.Until(drv => drv.FindElement(By.XPath(\"\/\/input&#x5B;@type='password']\")));\n\n            \/\/ \u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u5165\u529b\n            passwordElement.SendKeys(password);\n            passwordElement.SendKeys(Keys.Enter);\n        }\n    }\n}\n\n<\/pre><\/div>\n\n\n<p>\u3053\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u52d5\u4f5c\u3059\u308b\u3068\u30d6\u30e9\u30a6\u30b6\u304c\u7acb\u3061\u4e0a\u304c\u308a\u3001\u4ee5\u4e0b\u306e\u753b\u9762\u3092\u9806\u306b\u9032\u3093\u3067\u3044\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/itport.cloud\/wp-content\/uploads\/2020\/11\/2020-11-20_11h18_41.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"553\" src=\"https:\/\/itport.cloud\/wp-content\/uploads\/2020\/11\/2020-11-20_11h18_41-1024x553.png\" alt=\"\" class=\"wp-image-13117\" srcset=\"https:\/\/itport.cloud\/wp-content\/uploads\/2020\/11\/2020-11-20_11h18_41-1024x553.png 1024w, https:\/\/itport.cloud\/wp-content\/uploads\/2020\/11\/2020-11-20_11h18_41-300x162.png 300w, https:\/\/itport.cloud\/wp-content\/uploads\/2020\/11\/2020-11-20_11h18_41-768x415.png 768w, https:\/\/itport.cloud\/wp-content\/uploads\/2020\/11\/2020-11-20_11h18_41-450x243.png 450w, https:\/\/itport.cloud\/wp-content\/uploads\/2020\/11\/2020-11-20_11h18_41-900x486.png 900w, https:\/\/itport.cloud\/wp-content\/uploads\/2020\/11\/2020-11-20_11h18_41.png 1366w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/itport.cloud\/wp-content\/uploads\/2020\/11\/2020-11-20_11h19_24-1.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"467\" src=\"https:\/\/itport.cloud\/wp-content\/uploads\/2020\/11\/2020-11-20_11h19_24-1-1024x467.png\" alt=\"\" class=\"wp-image-13120\" srcset=\"https:\/\/itport.cloud\/wp-content\/uploads\/2020\/11\/2020-11-20_11h19_24-1-1024x467.png 1024w, https:\/\/itport.cloud\/wp-content\/uploads\/2020\/11\/2020-11-20_11h19_24-1-300x137.png 300w, https:\/\/itport.cloud\/wp-content\/uploads\/2020\/11\/2020-11-20_11h19_24-1-768x350.png 768w, https:\/\/itport.cloud\/wp-content\/uploads\/2020\/11\/2020-11-20_11h19_24-1-450x205.png 450w, https:\/\/itport.cloud\/wp-content\/uploads\/2020\/11\/2020-11-20_11h19_24-1-900x410.png 900w, https:\/\/itport.cloud\/wp-content\/uploads\/2020\/11\/2020-11-20_11h19_24-1.png 1366w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/itport.cloud\/wp-content\/uploads\/2020\/11\/2020-11-20_11h19_46.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"467\" src=\"https:\/\/itport.cloud\/wp-content\/uploads\/2020\/11\/2020-11-20_11h19_46-1024x467.png\" alt=\"\" class=\"wp-image-13119\" srcset=\"https:\/\/itport.cloud\/wp-content\/uploads\/2020\/11\/2020-11-20_11h19_46-1024x467.png 1024w, https:\/\/itport.cloud\/wp-content\/uploads\/2020\/11\/2020-11-20_11h19_46-300x137.png 300w, https:\/\/itport.cloud\/wp-content\/uploads\/2020\/11\/2020-11-20_11h19_46-768x350.png 768w, https:\/\/itport.cloud\/wp-content\/uploads\/2020\/11\/2020-11-20_11h19_46-450x205.png 450w, https:\/\/itport.cloud\/wp-content\/uploads\/2020\/11\/2020-11-20_11h19_46-900x410.png 900w, https:\/\/itport.cloud\/wp-content\/uploads\/2020\/11\/2020-11-20_11h19_46.png 1366w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p>\u3053\u306e\u30b3\u30fc\u30c9\u3067\u5909\u6570mailAddress\u3001password\u3078\u6e21\u3059\u5024\u306f\u81ea\u8eab\u306e\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3001\u30d1\u30b9\u30ef\u30fc\u30c9\u306b\u5909\u66f4\u3059\u308c\u3070\u30ed\u30b0\u30a4\u30f3\u307e\u3067\u81ea\u52d5\u3067\u3067\u304d\u307e\u3059\u3002<br><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\n\/\/ Selenium\u304c\u64cd\u4f5c\u3059\u308bWebDriver\u3092\u5ba3\u8a00\nvar options = new ChromeOptions();\nIWebDriver driver = new ChromeDriver(options);\n\n\/\/ Google\u30ed\u30b0\u30a4\u30f3\u753b\u9762\u3078\ndriver.Url = \"https:\/\/www.google.com\/accounts?hl=ja-JP\";\n\n<\/pre><\/div>\n\n\n<p>\u3053\u306e\u30b3\u30fc\u30c9\u3067Selenium\u3067\u64cd\u4f5c\u3059\u308bWebDriver\u3092\u5ba3\u8a00\u3057\u3066\u3044\u307e\u3059\u3002<br>\u3053\u3053\u3067\u306fChrome\u3092\u64cd\u4f5c\u3059\u308b\u305f\u3081ChromeDriver\u306b\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u4ed6\u306e\u30d6\u30e9\u30a6\u30b6\u3092\u64cd\u4f5c\u3057\u305f\u3044\u5834\u5408\u306f<br>Nuget\u3067\u305d\u306e\u30d6\u30e9\u30a6\u30b6\u306eWebDriver\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u5f8c\u3001\u3053\u306e\u30b3\u30fc\u30c9\u3092\u66f8\u304d\u63db\u3048\u308c\u3070\u5927\u4e08\u592b\u3067\u3059\u3002<br>\u305d\u306e\u5f8c\u6700\u521d\u306e\u30da\u30fc\u30b8\u306eURL\u3092\u6e21\u3057\u307e\u3059\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\n\/\/ \u8981\u7d20\u304c\u898b\u3064\u304b\u308b\u307e\u3067\u5f85\u6a5f\u3059\u308b\u305f\u3081\u306e\u6e96\u5099\nvar wait = new WebDriverWait(driver, TimeSpan.FromSeconds(30));\n<\/pre><\/div>\n\n\n<p>\u6b21\u306e\u64cd\u4f5c\u306f\u5165\u529b\u6b04\u3092\u6307\u5b9a\u3057\u3001\u305d\u306e\u5165\u529b\u6b04\u306b\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u5165\u529b\u3057\u307e\u3059\u3002<br>\u305f\u3060\u524d\u306e\u30b3\u30fc\u30c9\u3067URL\u3092\u6307\u5b9a\u3057\u3066\u30da\u30fc\u30b8\u9077\u79fb\u3092\u884c\u3044\u307e\u3057\u305f\u304c\u3001\u30da\u30fc\u30b8\u9077\u79fb\u304c\u7d42\u308f\u308b\u307e\u30671\u79d2\u4ee5\u4e0a\u6642\u9593\u304c\u304b\u304b\u308a\u307e\u3059\u3002<br>\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u51e6\u7406\u306f\u30df\u30ea\u79d2\u5358\u4f4d\u3067\u6b21\u306e\u51e6\u7406\u306b\u9032\u3080\u306e\u3067\u3001\u307a\u30fc\u30b8\u9077\u79fb\u524d\u306b\u6307\u5b9a\u3057\u305f\u5165\u529b\u6b04\u3092\u63a2\u305d\u3046\u3068\u3057\u3001<br>\u307a\u30fc\u30b8\u9077\u79fb\u304c\u7d42\u308f\u3063\u3066\u3044\u306a\u3044\u306e\u3067\u3001\u8981\u7d20\u304c\u5b58\u5728\u305b\u305a\u30a8\u30e9\u30fc\u3068\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002<br><br>\u305d\u306e\u305f\u3081\u3001\u6307\u5b9a\u3057\u305f\u6642\u9593\u306e\u9593\u3001\u8981\u7d20\u3092\u63a2\u3057\u3066\u3082\u3089\u3046\u3088\u3046\u306b\u3057\u307e\u3059\u3002<br>\u305d\u308c\u304c\u4e0a\u306e\u30b3\u30fc\u30c9\u3067\u3059\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\n\/\/ \u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u306e\u5165\u529b\u6b04\u3092\u63a2\u3059\n var mailAddressElement = wait.Until( drv => drv.FindElement( By.XPath(\"\/\/input&#x5B;@id='identifierId']\") ) );\n\n \/\/ \u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u5165\u529b\n mailAddressElement.SendKeys(mailAddress);\n mailAddressElement.SendKeys(Keys.Enter);\n<\/pre><\/div>\n\n\n<p>\u6b21\u306b\u5165\u529b\u6b04\u3092\u63a2\u3057\u3066\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u5165\u529b\u3059\u308b\u51e6\u7406\u3092\u66f8\u3044\u3066\u307e\u3059\u3002<br>\u3053\u3053\u3067\u306fFindElement\u30e1\u30bd\u30c3\u30c9\u306e\u5f15\u6570\u306b\u5165\u529b\u6b04\u306eHTML\u60c5\u5831\u3092\u6e21\u3057\u307e\u3059\u3002<br>XPath\u306b\u3064\u3044\u3066\u306f\u7701\u7565\u3057\u307e\u3059\u306e\u3067\u3001Selenium\u306e\u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3084\u89e3\u8aac\u30b5\u30a4\u30c8\u3092\u3054\u78ba\u8a8d\u304f\u3060\u3055\u3044\u3002<br><br>\u5f15\u6570\u306eHTML\u60c5\u5831\u306f\u5148\u307b\u3069\u958b\u767a\u8005\u30c4\u30fc\u30eb\u3067\u8abf\u3079\u305fHTML\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<br>\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u306e\u5165\u529b\u6b04\u306eHTML\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3057\u305f\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\n<input type=\"email\" class=\"whsOnd zHQkBf\" jsname=\"YPqjbf\" autocomplete=\"username\" spellcheck=\"false\" tabindex=\"0\" aria-label=\"\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u307e\u305f\u306f\u96fb\u8a71\u756a\u53f7\" name=\"identifier\" value=\"\" autocapitalize=\"none\" id=\"identifierId\" dir=\"ltr\" data-initial-dir=\"ltr\" data-initial-value=\"\">\n<\/pre><\/div>\n\n\n<p>\u3053\u3053\u3067\u306fHTML\u306e\u30bf\u30b0\u304c\u300cinput\u300d\u3067\u3001id\u304c\u300cidentifierId\u300d\u3068\u306a\u3063\u3066\u3044\u308b\u306e\u3067\u3001\u5f15\u6570\u306b\u306finput[@id=&#8217;identifierId&#8217;]\u3068\u6307\u5b9a\u3057\u307e\u3059\u3002<br>\u8981\u7d20\u304c\u898b\u3064\u304b\u3063\u305f\u3089\u3001SendKeys\u30e1\u30bd\u30c3\u30c9\u306e\u5f15\u6570\u306b\u5165\u529b\u3057\u305f\u3044\u5024\u3092\u6e21\u3057\u307e\u3059\u3002<br><br>\u6b21\u306e\u753b\u9762\u304c\u5909\u308f\u308b\u307e\u3067\u5f85\u3064\u51e6\u7406\u3068\u30d1\u30b9\u30ef\u30fc\u30c9\u306e\u5165\u529b\u3082\u540c\u69d8\u306a\u306e\u3067\u3001\u3053\u308c\u3067\u30ed\u30b0\u30a4\u30f3\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"topic5\">\u7d42\u308f\u308a<\/h2>\n\n\n\n<p>\u30d6\u30e9\u30a6\u30b6\u306e\u81ea\u52d5\u64cd\u4f5c\u306f\u610f\u5916\u3068\u7c21\u5358\u306b\u3067\u304d\u3001\u51e6\u7406\u6642\u9593\u3082\u305d\u3053\u307e\u3067\u304b\u304b\u3089\u306a\u3044\u3067\u3059\u3002<br>\u305f\u3060\u901a\u4fe1\u5148\u306f\u4f01\u696d\u3084\u5225\u306e\u4eba\u306e\u30b5\u30fc\u30d0\u30fc\u306a\u306e\u3067\u3001\u77ed\u6642\u9593\u3067\u4f55\u767e\u56de\u3001\u4f55\u5343\u56de\u3068\u3084\u308b\u3068\u30b5\u30fc\u30d0\u30fc\u653b\u6483\u3068\u307f\u306a\u3055\u308c\u307e\u3059\u306e\u3067\u3054\u6ce8\u610f\u3092\u3002<br>\u5229\u7528\u898f\u7d04\u3067\u81ea\u52d5\u64cd\u4f5c\u3092\u7981\u6b62\u3057\u3066\u3044\u308b\u30b5\u30a4\u30c8\u3082\u3042\u308b\u306e\u3067\u3001\u3088\u304f\u78ba\u8a8d\u3057\u3066\u304b\u3089\u884c\u3044\u307e\u3057\u3087\u3046\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u76ee\u6b21 \u306f\u3058\u3081\u306b\u958b\u767a\u8005\u30c4\u30fc\u30eb\u3092\u4f7f\u3063\u3066\u8981\u7d20\u3092\u7279\u5b9a \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u4f5c\u6210\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u7d42\u308f\u308a \u306f\u3058\u3081\u306b \u6700\u8fd1C#\u3067Selenium\u3092\u4f7f\u3063\u3066\u30d6\u30e9\u30a6\u30b6\u306e\u81ea\u52d5\u64cd\u4f5c\u3092\u3084\u3063\u3066\u307f\u305f\u306e\u3067\u3001\u305d\u306e\u5185\u5bb9\u3092\u8a18\u4e8b\u306b\u3057\u3088\u3046\u3068\u601d\u3044\u307e\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3067\u306e\u76ee\u6a19\u306f\u300c\u30d6\u30e9\u30a6\u30b6\u306e\u7acb\u3061\u4e0a\u3052\uff5eGoogle\u30a2\u30ab\u30a6\u30f3\u30c8\u3067\u30ed\u30b0\u30a4\u30f3\u3059\u308b\u307e\u3067\u3092\u81ea\u52d5\u5316\u3057\u3066\u307f\u308b\u300d\u3067\u3059\u3002\u74b0\u5883Windows10Visual Studio 2019 (C#)Google ChromeSelenium WebDriver \u958b\u767a\u8005\u30c4\u30fc\u30eb\u3092\u4f7f\u3063\u3066\u8981\u7d20\u3092\u7279\u5b9a \u4eca\u56de\u306eGoogle\u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u30ed\u30b0\u30a4\u30f3\u306e\u6d41\u308c\u306f\u3000\u30ed\u30b0\u30a4\u30f3\u30da\u30fc\u30b8\u2192\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u5165\u529b\u2192\u30d1\u30b9\u30ef\u30fc\u30c9\u5165\u529b\u2192\u30ed\u30b0\u30a4\u30f3\u306e\u9806\u306b\u884c\u3044\u307e\u3059\u3002 \u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u884c\u3046\u64cd\u4f5c\u3092\u6574\u7406\u3059\u308b\u3068\u30fb\u30ed\u30b0\u30a4\u30f3\u30da\u30fc\u30b8\u3078&hellip;","protected":false},"author":1,"featured_media":13114,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[96],"tags":[40],"class_list":{"0":"post-13098","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-selenium","8":"tag-article"},"_links":{"self":[{"href":"https:\/\/itport.cloud\/index.php?rest_route=\/wp\/v2\/posts\/13098","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itport.cloud\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itport.cloud\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itport.cloud\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/itport.cloud\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=13098"}],"version-history":[{"count":17,"href":"https:\/\/itport.cloud\/index.php?rest_route=\/wp\/v2\/posts\/13098\/revisions"}],"predecessor-version":[{"id":13226,"href":"https:\/\/itport.cloud\/index.php?rest_route=\/wp\/v2\/posts\/13098\/revisions\/13226"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/itport.cloud\/index.php?rest_route=\/wp\/v2\/media\/13114"}],"wp:attachment":[{"href":"https:\/\/itport.cloud\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=13098"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itport.cloud\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=13098"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itport.cloud\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=13098"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}