{"id":2901,"date":"2025-11-25T15:32:16","date_gmt":"2025-11-25T06:32:16","guid":{"rendered":"https:\/\/nao-kun.com\/?p=2901"},"modified":"2025-11-25T15:32:17","modified_gmt":"2025-11-25T06:32:17","slug":"selenium%e3%81%af%e3%82%82%e3%81%86%e6%99%82%e4%bb%a3%e9%81%85%e3%82%8c%ef%bc%9f%e3%82%b9%e3%82%af%e3%83%ac%e3%82%a4%e3%83%94%e3%83%b3%e3%82%b0%e3%81%afplaywright%e4%b8%80%e6%8a%9e%ef%bc%81%ef%bc%81","status":"publish","type":"post","link":"https:\/\/nao-kun.com\/?p=2901","title":{"rendered":"Selenium\u306f\u3082\u3046\u6642\u4ee3\u9045\u308c\uff1f\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u306fPlaywright\u4e00\u629e\uff01\uff01"},"content":{"rendered":"\n<p>\u300c\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u306e\u5f85\u3061\u6642\u9593\u3092\u8003\u616e\u3057\u3066<code>time.sleep()<\/code>\u3092\u5165\u308c\u305f\u306e\u306b\u3001\u8aad\u307f\u8fbc\u307f\u304c\u9045\u308c\u3066\u30a8\u30e9\u30fc\u306b\u306a\u3063\u305f\u300d<\/p>\n\n\n\n<p>\u304b\u3068\u8a00\u3063\u3066\u9577\u3081\u306b\u5f85\u3061\u6642\u9593\u3092\u8a2d\u5b9a\u3059\u308b\u3068\u3001\u4eca\u5ea6\u306f\u51e6\u7406\u5168\u4f53\u306e\u30b9\u30d4\u30fc\u30c9\u304c\u9045\u304f\u306a\u3063\u3066\u30a4\u30e9\u30a4\u30e9\u3059\u308b&#8230;<\/p>\n\n\n\n<p>Python\u3067\u306e\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u306b\u304a\u3044\u3066\u3001\u3053\u306e\u3088\u3046\u306a\u300cSelenium\u300d\u7279\u6709\u306e\u8abf\u6574\u306b\u75b2\u308c\u679c\u3066\u3066\u306f\u3044\u307e\u305b\u3093\u304b\uff1f<\/p>\n\n\n\n<p>\u3082\u3057\u3042\u306a\u305f\u304c\u4eca\u3067\u3082Selenium\u3092\u4f7f\u3063\u3066\u3044\u308b\u306a\u3089\u3001\u305d\u308c\u306f\u975e\u5e38\u306b\u3082\u3063\u305f\u3044\u306a\u3044\u3053\u3068\u3067\u3059\u3002\u7d50\u8ad6\u304b\u3089\u7533\u3057\u4e0a\u3052\u307e\u3059\u3002\u3053\u308c\u304b\u3089\u306ePython\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u306f\u300cPlaywright\u300d\u4e00\u629e\u3067\u3059\uff01\uff01<\/p>\n\n\n\n<p>\u672c\u8a18\u4e8b\u3067\u306f\u3001\u9577\u5e74Selenium\u306e\u300c\u5f85\u6a5f\u51e6\u7406\u5730\u7344\u300d\u3084\u300cWebDriver\u7ba1\u7406\u300d\u306b\u82e6\u3057\u3093\u3067\u304d\u305f\u79c1\u304c\u300cPlaywright\u300d\u306b\u4e57\u308a\u63db\u3048\u3066\u958b\u767a\u52b9\u7387\u304c\u5287\u7684\u306b\u5411\u4e0a\u3057\u305f\u7406\u7531\u3068\u3001\u305d\u306e\u5177\u4f53\u7684\u306a\u4f7f\u3044\u65b9\u3092\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u5b9f\u969b\u306b\u300cPlaywright\u300d\u3092\u4f7f\u3063\u3066\u307f\u3066\u3001\u79c1\u304c\u6700\u3082\u611f\u52d5\u3057\u305f\u306e\u306f\u4ee5\u4e0b\u306e\u70b9\u3067\u3059\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u5b8c\u4e86\u3092\u81ea\u52d5\u3067\u8a8d\u8b58\u3059\u308b\u305f\u3081<code>time.sleep()<\/code>\u306b\u3088\u308b\u7121\u99c4\u306a\u5f85\u6a5f\u6642\u9593\u304c\u30bc\u30ed\u306b\u306a\u3063\u305f\u3002<\/li>\n\n\n\n<li>\u300ccodegen\uff08\u30b3\u30fc\u30c9\u751f\u6210\u6a5f\u80fd\uff09\u300d\u3092\u4f7f\u3048\u3070\u3001\u30d6\u30e9\u30a6\u30b6\u3092\u64cd\u4f5c\u3059\u308b\u3060\u3051\u3067\u52dd\u624b\u306b\u30b3\u30fc\u30c9\u304c\u5b8c\u6210\u3059\u308b\u3002<\/li>\n\n\n\n<li>\u9762\u5012\u306aWebDriver\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3084\u30d1\u30b9\u901a\u3057\u304c\u4e00\u5207\u4e0d\u8981\u3002<\/li>\n<\/ul>\n\n\n\n<p>Selenium\u306f\u7d20\u6674\u3089\u3057\u3044\u30c4\u30fc\u30eb\u3067\u3059\u304c\u3001\u73fe\u4ee3\u306e\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u306b\u304a\u3044\u3066\u306f\u3001\u3082\u306f\u3084\u300c\u6642\u4ee3\u9045\u308c\u300d\u3068\u8a00\u308f\u3056\u308b\u3092\u5f97\u307e\u305b\u3093\u3002\u3053\u306e\u8a18\u4e8b\u3092\u8aad\u307f\u7d42\u3048\u305f\u9803\u306b\u306f\u3001\u3042\u306a\u305f\u3082\u9593\u9055\u3044\u306a\u304fSelenium\u3092\u5352\u696d\u3057\u3001Playwright\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u304f\u306a\u308b\u306f\u305a\u3067\u3059\u3002<\/p>\n\n\n\n<div class=\"swell-block-capbox cap_box\"><div class=\"cap_box_ttl\"><span>\u3053\u306e\u8a18\u4e8b\u3067\u308f\u304b\u308b\u3053\u3068<\/span><\/div><div class=\"cap_box_content\">\n<ul class=\"wp-block-list\">\n<li>Selenium\u30e6\u30fc\u30b6\u30fc\u304cPlaywright\u306b\u4e57\u308a\u63db\u3048\u308b\u3079\u304d\uff13\u3064\u306e\u6c7a\u5b9a\u7684\u306a\u7406\u7531<\/li>\n\n\n\n<li>\u9762\u5012\u306a\u5f85\u6a5f\u51e6\u7406\u3092\u64b2\u6ec5\u3059\u308b\u300cAuto-wait\u300d\u306e\u4ed5\u7d44\u307f<\/li>\n\n\n\n<li>\u64cd\u4f5c\u3059\u308b\u3060\u3051\u3067\u30b3\u30fc\u30c9\u304c\u81ea\u52d5\u751f\u6210\u3055\u308c\u308b\u300ccodegen\u300d\u306e\u885d\u6483\u7684\u306a\u4fbf\u5229\u3055<\/li>\n\n\n\n<li>Playwright\u306e\u5c0e\u5165\u304b\u3089\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9\u307e\u3067<\/li>\n<\/ul>\n<\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">\u306a\u305c\u300cSelenium\u306f\u6642\u4ee3\u9045\u308c\u300d\u3068\u8a00\u308f\u308c\u308b\u306e\u304b\uff1f3\u3064\u306e\u9650\u754c<\/h2>\n\n\n\n<p>\u9577\u5e74\u3001web\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u306e\u30c7\u30d5\u30a1\u30af\u30c8\u30b9\u30bf\u30f3\u30c0\u30fc\u30c9\u3068\u3057\u3066\u541b\u81e8\u3057\u3066\u304d\u305f\u300cSelenium\u300d\u3067\u3059\u304c\u3001\u8fd1\u5e74\u306eweb\u30a2\u30d7\u30ea\u306e\u9032\u5316\u306b\u4f34\u3044\u3001Selenium\u306e\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u3067\u306f\u5bfe\u5fdc\u3057\u304d\u308c\u306a\u3044\u300c\u69cb\u9020\u7684\u306a\u9650\u754c\u300d\u304c\u9732\u5448\u3057\u3066\u304d\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u591a\u304f\u306e\u30a8\u30f3\u30b8\u30cb\u30a2\u304c\u300cSelenium\u306f\u8f9b\u3044\u300d\u3068\u611f\u3058\u3001Playwright\u3078\u306e\u79fb\u884c\u3092\u6c7a\u610f\u3059\u308b\u4e3b\u306a\u7406\u7531\u306f\u3001\u4ee5\u4e0b\u306e3\u3064\u306e\u9650\u754c\u306b\u3042\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><code>time.sleep()<\/code>\u5730\u7344\uff1a\u4e0d\u5b89\u5b9a\u306a\u5f85\u6a5f\u51e6\u7406\u3068\u306e\u6226\u3044<\/h3>\n\n\n\n<p>Selenium\u3092\u4f7f\u7528\u3059\u308b\u4e0a\u3067\u3001\u6700\u3082\u958b\u767a\u8005\u3092\u60a9\u307e\u305b\u308b\u306e\u304c\u300c\u5f85\u6a5f\u51e6\u7406\u306e\u96e3\u3057\u3055\u300d\u3067\u3059\u3002<\/p>\n\n\n\n<p>Selenium\u306f\u3001web\u30da\u30fc\u30b8\u306e\u8aad\u307f\u8fbc\u307f\u3084\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u304c\u5b8c\u4e86\u3057\u305f\u3053\u3068\u3092\u6b63\u78ba\u306b\u5224\u65ad\u3059\u308b\u306e\u304c\u82e6\u624b\u3067\u3059\u3002\u305d\u306e\u305f\u3081\u3001\u958b\u767a\u8005\u306f\u30b3\u30fc\u30c9\u306e\u81f3\u308b\u3068\u3053\u308d\u306b<code>time.sleep()<\/code>\u306a\u3069\u306e\u5f85\u6a5f\u51e6\u7406\u3092\u624b\u52d5\u3067\u57cb\u3081\u8fbc\u3080\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u5177\u4f53\u7684\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30b8\u30ec\u30f3\u30de\u306b\u5e38\u306b\u76f4\u9762\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5f85\u3061\u6642\u9593\u304c\u77ed\u3044\u5834\u5408\uff1a\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3084\u8981\u7d20\u306e\u63cf\u753b\u304c\u9593\u306b\u5408\u308f\u300cNo such element exception\uff08\u8981\u7d20\u304c\u898b\u3064\u304b\u3089\u306a\u3044\uff09\u300d\u3068\u3044\u3046\u30a8\u30e9\u30fc\u3067\u51e6\u7406\u304c\u6b62\u307e\u3063\u3066\u3057\u307e\u3046\u3002<\/li>\n\n\n\n<li>\u5f85\u3061\u6642\u9593\u3092\u9577\u304f\u3057\u305f\u5834\u5408\uff1a\u5b89\u5168\u7b56\u3092\u53d6\u3063\u3066\u300c5\u79d2\u5f85\u6a5f\u300d\u3068\u8a2d\u5b9a\u3057\u305f\u3068\u304d\u3001\u5b9f\u969b\u306e\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u304c\u300c1\u79d2\u300d\u3067\u7d42\u308f\u3063\u305f\u3068\u3057\u3066\u3082\u3001\u6b8b\u308a\u306e4\u79d2\u9593\u306f\u305f\u3060\u5f85\u3064\u3060\u3051\u306e\u7121\u99c4\u306a\u6642\u9593\u304c\u767a\u751f\u3059\u308b\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u79c1\u81ea\u8eab\u3001Selenium\u3067\u958b\u767a\u3057\u3066\u3044\u305f\u9803\u306f\u3001\u3053\u306e\u300c\u898b\u3048\u306a\u3044\u5f85\u3061\u6642\u9593\u300d\u3068\u306e\u6226\u3044\u306b\u660e\u3051\u66ae\u308c\u3066\u3044\u307e\u3057\u3002\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u306e\u30bf\u30a4\u30df\u30f3\u30b0\u306f\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u72b6\u6cc1\u306b\u3088\u3063\u3066\u5909\u308f\u308b\u305f\u3081\u3001\u6628\u65e5\u52d5\u3044\u305f\u30b3\u30fc\u30c9\u304c\u4eca\u65e5\u306f\u30a8\u30e9\u30fc\u306b\u306a\u308b\u3001\u3068\u3044\u3046\u4e0d\u5b89\u5b9a\u3055\u304c\u5e38\u306b\u4ed8\u304d\u307e\u3068\u3044\u307e\u3059\u3002\u3053\u306e\u300c\u4e0d\u5b89\u5b9a\u306a\u5f85\u6a5f\u51e6\u7406\u300d\u3053\u305d\u304c\u3001Selenium\u306f\u6700\u5927\u306e\u30dc\u30c8\u30eb\u30cd\u30c3\u30af\u3067\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">WebDriver\u7ba1\u7406\u306e\u624b\u9593\uff1a\u74b0\u5883\u69cb\u7bc9\u306e\u7169\u308f\u3057\u3055<\/h3>\n\n\n\n<p>2\u3064\u76ee\u306e\u9650\u754c\u306f\u3001\u30d6\u30e9\u30a6\u30b6\u3092\u64cd\u4f5c\u3059\u308b\u305f\u3081\u306b\u5fc5\u9808\u3068\u306a\u308b\u300cWebDriver\u300d\u306e\u7ba1\u7406\u30b3\u30b9\u30c8\u3067\u3059\u3002<\/p>\n\n\n\n<p>Selenium\u3092\u52d5\u304b\u3059\u305f\u3081\u306b\u306f\u3001\u64cd\u4f5c\u3059\u308bGoogle Chrome\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u4e00\u81f4\u3059\u308b\u300cChrome Driver\u300d\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3001\u30d1\u30b9\u3092\u901a\u3059\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u3057\u304b\u3057\u3001Chrome\u306f\u983b\u7e41\u306b\u81ea\u52d5\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3055\u308c\u308b\u305f\u3081\u3001\u3042\u308b\u65e5\u7a81\u7136\u30d0\u30fc\u30b8\u30e7\u30f3\u4e0d\u4e00\u81f4\u306e\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u3001\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u304c\u52d5\u304b\u306a\u304f\u306a\u308b\u3068\u3044\u3046\u4e8b\u6545\u304c\u591a\u767a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version XX...<\/code><\/pre>\n\n\n\n<p>\u30a8\u30e9\u30fc\u753b\u9762\u3092\u898b\u3066\u3001\u7d76\u671b\u3057\u305f\u7d4c\u9a13\u304c\u3042\u308b\u65b9\u3082\u591a\u3044\u306e\u3067\u306f\u306a\u3044\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n\n\n\n<p>\u8fd1\u5e74\u3067\u306f\u5b9f\u884c\u6642\u306b\u81ea\u52d5\u3067\u30c9\u30e9\u30a4\u30d0\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u30e9\u30a4\u30d6\u30e9\u30ea\u3082\u767b\u5834\u3057\u307e\u3057\u305f\u304c\u3001\u305d\u308c\u3092\u4f7f\u7528\u3057\u3066\u3082\u6bce\u56de\u306e\u5b9f\u884c\u6642\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u51e6\u7406\u304c\u8d70\u308b\u305f\u3081\u3001\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u306e\u958b\u59cb\u307e\u3067\u306b\u6642\u9593\u304c\u304b\u304b\u308b\u3068\u3044\u3046\u65b0\u305f\u306a\u554f\u984c\u304c\u767a\u751f\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u74b0\u5883\u69cb\u7bc9\u306e\u624b\u9593\u3068\u3001\u7dad\u6301\u7ba1\u7406\u306e\u30b3\u30b9\u30c8\u3002\u3053\u308c\u3089\u306f\u958b\u767a\u306e\u672c\u8cea\u3067\u306f\u306a\u3044\u300c\u96d1\u52d9\u300d\u3067\u3042\u308a\u3001\u958b\u767a\u8005\u306e\u6642\u9593\u3092\u596a\u3046\u5927\u304d\u306a\u8981\u56e0\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u958b\u767a\u30b9\u30d4\u30fc\u30c9\u306e\u920d\u5316\uff1a\u8981\u7d20\u7279\u5b9a\u3068\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u306e\u5f80\u5fa9<\/h3>\n\n\n\n<p>3\u3064\u76ee\u306e\u9650\u754c\u306f\u3001\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u30b3\u30fc\u30c9\u3092\u4f5c\u6210\u3059\u308b\u969b\u306e\u624b\u9806\u306e\u591a\u3055\u3067\u3059\u3002<\/p>\n\n\n\n<p>Selenium\u3067\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u5834\u5408\u3001\u4e00\u822c\u7684\u306b\u306f\u4ee5\u4e0b\u306e\u30d5\u30ed\u30fc\u3092\u7e70\u308a\u8fd4\u3059\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u64cd\u4f5c\u3057\u305f\u3044\u30d6\u30e9\u30a6\u30b6\u3092\u958b\u304d\u3001\u30c7\u30d9\u30ed\u30c3\u30d1\u30fc\u30c4\u30fc\u30eb\u3092\u8d77\u52d5\u3059\u308b\u3002<\/li>\n\n\n\n<li>\u5bfe\u8c61\u306e\u30dc\u30bf\u30f3\u3084\u5165\u529b\u30d5\u30a9\u30fc\u30e0\u306e\u8981\u7d20\uff08HTML\uff09\u3092\u63a2\u3059\u3002<\/li>\n\n\n\n<li>\u305d\u306e\u8981\u7d20\u3092\u4e00\u610f\u306b\u7279\u5b9a\u3067\u304d\u308b\u300cXPath\u300d\u3084\u300cCSS\u30bb\u30ec\u30af\u30bf\u300d\u3092\u8003\u3048\u3001\u30b3\u30d4\u30fc\u3059\u308b\u3002<\/li>\n\n\n\n<li>\u30a8\u30c7\u30a3\u30bf\u306b\u623b\u308a<code>driver.find_element(By.XPATH, \"...\")<\/code>\u3068\u8a18\u8ff0\u3059\u308b\u3002<\/li>\n<\/ol>\n\n\n\n<p>\u3053\u306e\u300c\u30d6\u30e9\u30a6\u30b6\u3067\u8981\u7d20\u3092\u8abf\u3079\u3066\u3001\u30a8\u30c7\u30a3\u30bf\u306b\u66f8\u304d\u5199\u3059\u300d\u3068\u3044\u3046\u53cd\u5fa9\u4f5c\u696d\u306f\u3001\u975e\u5e38\u306b\u6ce5\u81ed\u304f\u3001\u6642\u9593\u304c\u304b\u304b\u308a\u307e\u3059\u3002\u307e\u305f\u82e6\u52b4\u3057\u3066\u66f8\u3044\u305fXPATH\u304c\u3001\u30b5\u30a4\u30c8\u306e\u30c7\u30b6\u30a4\u30f3\u5909\u66f4\u3067\u5c11\u3057\u5909\u308f\u3063\u305f\u3060\u3051\u3067\u52d5\u304b\u306a\u304f\u306a\u308b\u3053\u3068\u3082\u65e5\u5e38\u8336\u98ef\u4e8b\u3067\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u306e\u65b0\u738b\u8005\u300cPlaywright\u300d\u304c\u512a\u308c\u3066\u3044\u308b3\u3064\u306e\u7406\u7531<\/h2>\n\n\n\n<p>Selenium\u304c\u62b1\u3048\u308b\u6570\u3005\u306e\u30b9\u30c8\u30ec\u30b9\u304b\u3089\u3001\u30a8\u30f3\u30b8\u30cb\u30a2\u3092\u958b\u653e\u3059\u308b\u305f\u3081\u306b\u751f\u307e\u308c\u305f\u306e\u304c\u3001Microsoft\u88fd\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u300cPlaywright\u300d\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u79c1\u304cSelenium\u304b\u3089Playwright\u306b\u4e57\u308a\u63db\u3048\u3066\u3001\u6700\u3082\u885d\u6483\u3092\u53d7\u3051\u305f\u306e\u306f\u3001\u5358\u306b\u300c\u65b0\u3057\u3044\u300d\u304b\u3089\u3067\u306f\u306a\u304f\u3001Selenium\u3067\u82e6\u52b4\u3057\u3066\u3044\u305f\u90e8\u5206\u304c\u3001\u3059\u3079\u3066\u89e3\u6d88\u3055\u308c\u305f\u304b\u3089\u3067\u3059\u3002\u5177\u4f53\u7684\u306b\u4f55\u304c\u512a\u308c\u3066\u3044\u308b\u306e\u304b\u3001\u305d\u306e\u6c7a\u5b9a\u7684\u306a3\u3064\u306e\u7406\u7531\u3092\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u3010Auto-wait\u3011\u5f85\u6a5f\u51e6\u7406\u306e\u81ea\u52d5\u5316\u3067\u7121\u99c4\u306a\u6642\u9593\u304c\u30bc\u30ed\u306b<\/h3>\n\n\n\n<p>Playwright\u6700\u5927\u306e\u9769\u547d\u306f\u300cAuto-wait\uff08\u81ea\u52d5\u5f85\u6a5f\uff09\u300d\u3068\u3044\u3046\u4ed5\u7d44\u307f\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u308c\u306f\u30b3\u30fc\u30c9\u3067\u660e\u793a\u7684\u306b\u6307\u793a\u3057\u306a\u304f\u3066\u3082\u3001Playwright\u5074\u304c\u300c\u8981\u7d20\u304c\u8868\u793a\u3055\u308c\u308b\u307e\u3067\u300d\u30fb\u300c\u30af\u30ea\u30c3\u30af\u53ef\u80fd\u306b\u306a\u308b\u307e\u3067\u300d\u30fb\u300c\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u304c\u5b8c\u4e86\u3059\u308b\u307e\u3067\u300d\u3068\u3044\u3063\u305f\u30a2\u30af\u30b7\u30e7\u30f3\u306e\u5b8c\u4e86\u3092\u3001\u81ea\u52d5\u7684\u304b\u3064\u8ce2\u304f\u5f85\u3063\u3066\u304f\u308c\u308b\u6a5f\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n<p>Selenium\u6642\u4ee3\u306f\u3001\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u51e6\u7406\u306e\u524d\u306b<code>time.sleep(3)<\/code>\u3068\u3044\u3063\u305f\u5f85\u6a5f\u30b3\u30fc\u30c9\u3092\u5165\u308c\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3057\u305f\u3002\u3057\u304b\u3057\u3001Playwright\u3067\u306f\u305d\u306e\u5fc5\u8981\u304c\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n\n\n<div class=\"swell-block-balloon\"><div class=\"c-balloon -bln-left\" data-col=\"green\"><div class=\"c-balloon__icon -circle\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/nao-kun.com\/wp-content\/uploads\/2025\/09\/\u65b0\u306a\u304a\u304f\u3093-150x150.png\" alt=\"\" class=\"c-balloon__iconImg\" width=\"80px\" height=\"80px\"><span class=\"c-balloon__iconName\">\u306a\u304a\u304f\u3093<\/span><\/div><div class=\"c-balloon__body -speaking -border-none\"><div class=\"c-balloon__text\">\n<p>\u6b63\u76f4\u3001\u3053\u306e\u6a5f\u80fd\u306b\u306f\u611f\u52d5\u3057\u307e\u3057\u305f\u3002<br>\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u306b\u304b\u304b\u308b\u6642\u9593\u3092\u8003\u616e\u3057\u306a\u304f\u3066\u826f\u3044\u306a\u3093\u3066&#8230;!!<\/p>\n<span class=\"c-balloon__shapes\"><span class=\"c-balloon__before\"><\/span><span class=\"c-balloon__after\"><\/span><\/span><\/div><\/div><\/div><\/div>\n\n\n<p>\u79c1\u304c\u5b9f\u969b\u306b\u958b\u767a\u3092\u884c\u3063\u3066\u3044\u3066\u611f\u3058\u305f\u306e\u306f\u3001\u7121\u99c4\u306a\u5f85\u3061\u6642\u9593\u304c\u5fb9\u5e95\u7684\u306b\u524a\u304e\u843d\u3068\u3055\u308c\u3066\u3044\u308b\u3068\u3044\u3046\u70b9\u3067\u3059\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u304c\u901f\u3044\u6642\uff1aPlaywright\u306f\u5b8c\u4e86\u3092\u5373\u5ea7\u306b\u691c\u77e5\u3057\u30010.1\u79d2\u3082\u7121\u99c4\u306b\u305b\u305a\u6b21\u306e\u51e6\u7406\u306b\u9032\u307f\u307e\u3059\u3002<\/li>\n\n\n\n<li>\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u304c\u9045\u3044\u6642\uff1a\u5fc5\u8981\u306a\u5206\u3060\u3051\u5f85\u3061\u3001\u5b8c\u4e86\u6b21\u7b2c\u3059\u3050\u306b\u52d5\u304d\u307e\u3059\u3002<\/li>\n<\/ul>\n\n\n\n<p>Selenium\u3067\u56fa\u5b9a\u306e\u5f85\u3061\u6642\u9593\u3092\u8a2d\u5b9a\u3057\u3066\u3044\u305f\u9803\u306f\u3001\u3059\u3050\u306b\u7d42\u308f\u308b\u51e6\u7406\u3067\u3082\u6307\u5b9a\u6642\u9593\uff08\u4f8b\uff1a5\u79d2\uff09\u5f85\u305f\u3055\u308c\u308b\u3068\u3044\u3046\u300c\u7121\u99c4\u300d\u304c\u767a\u751f\u3057\u3066\u3044\u307e\u3057\u305f\u304c\u3001Playwright\u306f\u305d\u306e\u30ed\u30b9\u3092\u6700\u5c0f\u9650\u306b\u6700\u9069\u5316\u3057\u3066\u304f\u308c\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u4f8b\u5916\u51e6\u7406\u304c\u6fc0\u6e1b\u3057\u3001\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u5b89\u5b9a\u6027\u304c\u98db\u8e8d\u7684\u306b\u5411\u4e0a\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u3010\u7206\u901f\u74b0\u5883\u69cb\u7bc9\u3011\u30b3\u30de\u30f3\u30c9\u4e00\u767a\u3067\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u5b8c\u4e86<\/h3>\n\n\n\n<p>2\u3064\u76ee\u306e\u7406\u7531\u306f\u3001\u74b0\u5883\u69cb\u7bc9\u306e\u624b\u8efd\u3055\u3067\u3059\u3002<\/p>\n\n\n\n<p>Selenium\u3067\u306f\u3001Chrome\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u5408\u308f\u305b\u305fWebDriver\uff08ChromeDriver\uff09\u3092\u624b\u52d5\u3067\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3001\u30d1\u30b9\u3092\u901a\u3059\u5fc5\u8981\u304c\u3042\u308a\u307e\u3057\u305f\u3002\u307e\u305f\u30d6\u30e9\u30a6\u30b6\u304c\u81ea\u52d5\u66f4\u65b0\u3055\u308c\u308b\u305f\u3073\u306b\u30c9\u30e9\u30a4\u30d0\u3082\u66f4\u65b0\u3057\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u3068\u3044\u3046\u300c\u3044\u305f\u3061\u3054\u3063\u3053\u300d\u304c\u767a\u751f\u3057\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u3057\u304b\u3057\u3001Playwright\u306e\u74b0\u5883\u69cb\u7bc9\u306f\u9a5a\u304f\u307b\u3069\u30b7\u30f3\u30d7\u30eb\u3067\u3059\u3002\u4ee5\u4e0b\u306e2\u3064\u306e\u30b3\u30de\u30f3\u30c9\u3092\u6253\u3064\u3060\u3051\u3067\u5b8c\u4e86\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pip install playwright\nplaywright install<\/code><\/pre>\n\n\n\n<p>\u3053\u308c\u3060\u3051\u3067\u3001Playwright\u5c02\u7528\u306b\u30c1\u30e5\u30fc\u30cb\u30f3\u30b0\u3055\u308c\u305f\u30d6\u30e9\u30a6\u30b6\u30d0\u30a4\u30ca\u30ea\uff08Chromium\u3001Firefox\u3001WebKit\uff09\u304c\u4e00\u62ec\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"905\" src=\"https:\/\/nao-kun.com\/wp-content\/uploads\/2025\/11\/2025-11-23_08h11_18-1024x905.png\" alt=\"\" class=\"wp-image-3009\" srcset=\"https:\/\/nao-kun.com\/wp-content\/uploads\/2025\/11\/2025-11-23_08h11_18-1024x905.png 1024w, https:\/\/nao-kun.com\/wp-content\/uploads\/2025\/11\/2025-11-23_08h11_18-300x265.png 300w, https:\/\/nao-kun.com\/wp-content\/uploads\/2025\/11\/2025-11-23_08h11_18-768x678.png 768w, https:\/\/nao-kun.com\/wp-content\/uploads\/2025\/11\/2025-11-23_08h11_18.png 1166w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u79c1\u81ea\u8eab\u3001Selenium\u3092\u4f7f\u3063\u3066\u3044\u305f\u9803\u306f\u3001\u5b9f\u884c\u6642\u306bWebDriver\u3092\u81ea\u52d5\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u30e9\u30a4\u30d6\u30e9\u30ea\uff08webdriver_manager\uff09\u3092\u4f7f\u3063\u3066\u3044\u307e\u3057\u305f\u304c\u3001\u305d\u308c\u3067\u3082\u6bce\u56de\u306e\u5b9f\u884c\u6642\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u78ba\u8a8d\u306e\u901a\u4fe1\u304c\u8d70\u308a\u3001\u8d77\u52d5\u307e\u3067\u306b\u6570\u79d2\u5f85\u305f\u3055\u308c\u308b\u3068\u3044\u3046\u30b9\u30c8\u30ec\u30b9\u304c\u3042\u308a\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>Playwright\u306f\u3001\u4e00\u5ea6\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308c\u3070\u305d\u306e\u5f8c\u306e\u8d77\u52d5\u306f\u7206\u901f\u3067\u3059\u3002\u300c\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3057\u305f\u77ac\u9593\u306b\u30d6\u30e9\u30a6\u30b6\u304c\u7acb\u3061\u4e0a\u304c\u308b\u300d\u3068\u3044\u3046\u5f53\u305f\u308a\u524d\u306e\u5feb\u9069\u3055\u304c\u3001\u3053\u3053\u306b\u306f\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u3010\u9ad8\u901f\u52d5\u4f5c\u3011\u5b9f\u884c\u901f\u5ea6\u3068\u5b89\u5b9a\u6027\u306e\u4e21\u7acb<\/h3>\n\n\n\n<p>3\u3064\u76ee\u306e\u7406\u7531\u306f\u3001\u5727\u5012\u7684\u306a\u300c\u5b9f\u884c\u901f\u5ea6\u300d\u3068\u300c\u5b89\u5b9a\u6027\u300d\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u3082\u3061\u308d\u3093\u3001\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u306e\u901f\u5ea6\u306f\u76f8\u624b\u30b5\u30fc\u30d0\u30fc\u306e\u5fdc\u7b54\u901f\u5ea6\u306b\u4f9d\u5b58\u3059\u308b\u305f\u3081\u3001\u901a\u4fe1\u90e8\u5206\u3060\u3051\u3067\u898b\u308c\u3070Selenium\u3068\u5927\u5dee\u306a\u3044\u5834\u5408\u3082\u3042\u308a\u307e\u3059\u3002\u3057\u304b\u3057\u3001\u30b9\u30af\u30ea\u30d7\u30c8\u5168\u4f53\u306e\u51e6\u7406\u6642\u9593\u3067\u898b\u308b\u3068\u3001Playwright\u306e\u65b9\u304c\u78ba\u5b9f\u306b\u901f\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u305d\u306e\u7406\u7531\u306f\u3001\u524d\u8ff0\u3057\u305f2\u3064\u306e\u7279\u5fb4\u306e\u76f8\u4e57\u52b9\u679c\u3067\u3059\u3002<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u8d77\u52d5\u306e\u901f\u3055\uff1aWebDriver\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u78ba\u8a8d\u304c\u306a\u3044\u305f\u3081\u3001\u5b9f\u884c\u76f4\u5f8c\u304b\u3089\u51e6\u7406\u304c\u59cb\u307e\u308b\u3002<\/li>\n\n\n\n<li>\u5f85\u6a5f\u306e\u6700\u9069\u5316\uff1aAuto-wait\u306b\u3088\u308a\u3001\u7121\u99c4\u306a\u30a2\u30a4\u30c9\u30ea\u30f3\u30b0\u30bf\u30a4\u30e0\u304c\u767a\u751f\u3057\u306a\u3044\u3002<\/li>\n<\/ol>\n\n\n\n<p>\u307e\u305f\u3001\u500b\u4eba\u7684\u306b\u5354\u8abf\u3057\u305f\u3044\u306e\u306f\u300c\u30a8\u30e9\u30fc\u843d\u3061\u306e\u5c11\u306a\u3055\u300d\u3067\u3059\u3002Selenium\u3067\u306f\u3001\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u306e\u30bf\u30a4\u30df\u30f3\u30b0\u306b\u3088\u3063\u3066\u300c\u8981\u7d20\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093\u300d\u3068\u3044\u3046\u30a8\u30e9\u30fc\u304c\u983b\u767a\u3057\u3066\u3044\u307e\u3057\u305f\u304c\u3001Playwrigh\u306fDOM\u306e\u5909\u5316\u3092\u3088\u308a\u6df1\u304f\u76e3\u8996\u3057\u3066\u3044\u308b\u305f\u3081\u3001\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u76f4\u5f8c\u3067\u3082\u6b63\u78ba\u306b\u8981\u7d20\u3092\u63b4\u3093\u3067\u304f\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u300c\u30a8\u30e9\u30fc\u3067\u6b62\u307e\u3063\u305f\u304b\u3089\u518d\u5b9f\u884c\u3057\u306a\u304d\u3083&#8230;\u300d\u3068\u3044\u3046\u624b\u623b\u308a\u306e\u6642\u9593\u304c\u306a\u304f\u306a\u308b\u3053\u3068\u3053\u305d\u3001\u6700\u5927\u306e\u300c\u6642\u77ed\u300d\u3068\u3044\u3048\u308b\u3067\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u3010\u5b9f\u6f14\u3011Playwright\u306e\u300c\u30b3\u30fc\u30c9\u751f\u6210\u6a5f\u80fd(codegen)\u300d\u306b\u611f\u52d5\u305b\u3088<\/h2>\n\n\n\n<p>\u3053\u3053\u307e\u3067Playwrigh\u306e\u6027\u80fd\u9762\u3067\u306e\u30e1\u30ea\u30c3\u30c8\u3092\u304a\u4f1d\u3048\u3057\u307e\u3057\u305f\u304c\u3001\u79c1\u304cSelenium\u304b\u3089\u4e57\u308a\u63db\u3048\u305f\u6700\u5927\u306e\u6c7a\u5b9a\u6253\u306f\u3001\u3053\u306e\u6a5f\u80fd\u306b\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u305d\u308c\u304c\u300ccodegen\uff08\u30b3\u30fc\u30c9\u751f\u6210\u6a5f\u80fd\uff09\u300d\u3067\u3059\u3002<\/p>\n\n\n<div class=\"swell-block-balloon\"><div class=\"c-balloon -bln-left\" data-col=\"green\"><div class=\"c-balloon__icon -circle\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/nao-kun.com\/wp-content\/uploads\/2025\/09\/\u65b0\u306a\u304a\u304f\u3093-150x150.png\" alt=\"\" class=\"c-balloon__iconImg\" width=\"80px\" height=\"80px\"><span class=\"c-balloon__iconName\">\u306a\u304a\u304f\u3093<\/span><\/div><div class=\"c-balloon__body -speaking -border-none\"><div class=\"c-balloon__text\">\n<p>\u521d\u3081\u3066\u3053\u306e\u6a5f\u80fd\u3092\u4f7f\u3063\u305f\u6642\u3001\u3042\u307e\u308a\u306e\u7c21\u5358\u3055\u306b\u300c\u4eca\u307e\u3067\u306e\u82e6\u52b4\u306f\u4f55\u3060\u3063\u305f\u3093\u3060&#8230;\u300d\u3068\u5446\u7136\u3068\u3057\u307e\u3057\u305f\u3002\u3053\u308c\u306f\u3001\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u958b\u767a\u306e\u6982\u5ff5\u3092\u8986\u3059\u300c\u9b54\u6cd5\u300d\u3067\u3059\u3002<\/p>\n<span class=\"c-balloon__shapes\"><span class=\"c-balloon__before\"><\/span><span class=\"c-balloon__after\"><\/span><\/span><\/div><\/div><\/div><\/div>\n\n\n<h3 class=\"wp-block-heading\">\u30b5\u30a4\u30c8\u3092\u64cd\u4f5c\u3059\u308b\u3060\u3051\uff1f\u9b54\u6cd5\u306e\u3088\u3046\u306a\u958b\u767a\u4f53\u9a13<\/h3>\n\n\n\n<p>Selenium\u3067\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u3068\u304d\u3001\u79c1\u305f\u3061\u306f\u300c\u7ffb\u8a33\u5bb6\u300d\u306e\u3088\u3046\u306a\u4f5c\u696d\u3092\u5f37\u3044\u3089\u308c\u3066\u304d\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u30d6\u30e9\u30a6\u30b6\u3067\u30dc\u30bf\u30f3\u3092\u898b\u3064\u3051\u308b\u3002<\/li>\n\n\n\n<li>\u30c7\u30d9\u30ed\u30c3\u30d1\u30fc\u30c4\u30fc\u30eb\u3092\u958b\u3044\u3066\u3001\u305d\u306e\u30dc\u30bf\u30f3\u3092\u8868\u3059HTML\u30bf\u30b0\uff08XPATH\u3084CSS\u30bb\u30ec\u30af\u30bf\uff09\u3092\u63a2\u3057\u51fa\u3059\u3002<\/li>\n\n\n\n<li>\u305d\u308c\u3092Python\u30b3\u30fc\u30c9\u306b\u66f8\u304d\u5199\u3059\u3002<\/li>\n<\/ol>\n\n\n\n<p>\u3053\u306e\u300c\u30b5\u30a4\u30c8\u300d\u3068\u300c\u30b3\u30fc\u30c9\u300d\u3092\u884c\u304d\u6765\u3059\u308b\u5730\u5473\u306a\u4f5c\u696d\u304c\u3001\u958b\u767a\u6642\u9593\u306e8\u5272\u3092\u596a\u3063\u3066\u3044\u305f\u3068\u8a00\u3063\u3066\u3082\u904e\u8a00\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<p>\u3057\u304b\u3057\u3001Playwright\u306e\u300ccodegen\u300d\u3092\u4f7f\u3048\u3070\u3001\u3053\u306e\u4f5c\u696d\u306f\u4e00\u5207\u4e0d\u8981\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3042\u306a\u305f\u304c\u3084\u308b\u3079\u304d\u3053\u3068\u306f\u300c\u305f\u3060\u3001\u30d6\u30e9\u30a6\u30b6\u3092\u64cd\u4f5c\u3059\u308b\u3053\u3068\u300d\u3060\u3051\u3067\u3059\u3002Playwright\u3092\u9332\u753b\u30e2\u30fc\u30c9\u3067\u8d77\u52d5\u3057\u3001\u30af\u30ea\u30c3\u30af\u3084\u5165\u529b\u3092\u884c\u3046\u3068\u3001\u305d\u306e\u64cd\u4f5c\u304c\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u3067Python\u30b3\u30fc\u30c9\u3068\u3057\u3066\u81ea\u52d5\u751f\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u308c\u307e\u3067\u306f\u3001\u8907\u96d1\u306a\u968e\u5c64\u306b\u3042\u308b\u8981\u7d20\u3092\u6307\u5b9a\u3059\u308b\u305f\u3081\u306b\u3001\u982d\u3092\u62b1\u3048\u306a\u304c\u3089XPath\u3092\u7d44\u307f\u7acb\u3066\u3066\u3044\u307e\u3057\u305f\u3002\u3057\u304b\u3057\u3001Playwright\u306a\u3089\u3001\u3042\u306a\u305f\u304c\u30af\u30ea\u30c3\u30af\u3057\u305f\u305d\u306e\u5834\u6240\u3092\u3001AI\u306e\u3088\u3046\u306b\u8ce2\u3044\u30ed\u30b1\u30fc\u30bf\u304c\u81ea\u52d5\u7684\u306b\u7279\u5b9a\u3057\u3001\u6700\u3082\u58ca\u308c\u306b\u304f\u3044\u30b3\u30fc\u30c9\u3092\u751f\u6210\u3057\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u5b9f\u969b\u306e\u751f\u6210\u624b\u9806\uff1a3\u30b9\u30c6\u30c3\u30d7\u3067\u30b3\u30fc\u30c9\u304c\u5b8c\u6210<\/h3>\n\n\n\n<p>\u3067\u306f\u3001\u5b9f\u969b\u306b\u3069\u308c\u307b\u3069\u7c21\u5358\u306b\u30b3\u30fc\u30c9\u304c\u4f5c\u308c\u308b\u306e\u304b\u3001\u305d\u306e\u624b\u9806\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002\u305f\u3063\u305f\u306e3\u30b9\u30c6\u30c3\u30d7\u3067\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u30b9\u30c6\u30c3\u30d71\uff1a\u30bf\u30fc\u30df\u30ca\u30eb\u3067\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b<\/h4>\n\n\n\n<p>\u307e\u305a\u3001\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u3057\u305f\u3044\u30b5\u30a4\u30c8\u306eURL\u3092\u6307\u5b9a\u3057\u3066\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002\u3053\u3053\u3067\u306f\u4f8b\u3068\u3057\u3066\u3001Python\u306e\u516c\u5f0f\u30b5\u30a4\u30c8\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>playwright codegen https:\/\/playwright.dev\/python\/<\/code><\/pre>\n\n\n\n<p>\u3082\u3057\u751f\u6210\u3057\u305f\u30b3\u30fc\u30c9\u3049\u76f4\u63a5\u30d5\u30a1\u30a4\u30eb\u306b\u4fdd\u5b58\u3057\u305f\u3044\u5834\u5408\u306f<code>-o<\/code>\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4f7f\u3044\u307e\u3059\u3002\uff08\u63a8\u5968\uff09<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \u64cd\u4f5c\u5185\u5bb9\u3092 main.py \u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u306b\u4fdd\u5b58\u3059\u308b\u5834\u5408\nplaywright codegen -o main.py https:\/\/playwright.dev\/python\/<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"556\" src=\"https:\/\/nao-kun.com\/wp-content\/uploads\/2025\/11\/2025-11-23_08h15_44-1024x556.png\" alt=\"\" class=\"wp-image-3010\" srcset=\"https:\/\/nao-kun.com\/wp-content\/uploads\/2025\/11\/2025-11-23_08h15_44-1024x556.png 1024w, https:\/\/nao-kun.com\/wp-content\/uploads\/2025\/11\/2025-11-23_08h15_44-300x163.png 300w, https:\/\/nao-kun.com\/wp-content\/uploads\/2025\/11\/2025-11-23_08h15_44-768x417.png 768w, https:\/\/nao-kun.com\/wp-content\/uploads\/2025\/11\/2025-11-23_08h15_44-1536x833.png 1536w, https:\/\/nao-kun.com\/wp-content\/uploads\/2025\/11\/2025-11-23_08h15_44.png 1900w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">\u30b9\u30c6\u30c3\u30d72\uff1a\u30d6\u30e9\u30a6\u30b6\u3067\u64cd\u4f5c\u3092\u884c\u3046<\/h4>\n\n\n\n<p>\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e2\u3064\u306e\u30a6\u30a3\u30f3\u30c9\u30a6\u304c\u7acb\u3061\u4e0a\u304c\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u64cd\u4f5c\u7528\u30d6\u30e9\u30a6\u30b6\uff1a\u3042\u306a\u305f\u304c\u64cd\u4f5c\u3059\u308b\u305f\u3081\u306e\u753b\u9762\u3002<\/li>\n\n\n\n<li>Playwright Inspector\uff1a\u751f\u6210\u3055\u308c\u305f\u30b3\u30fc\u30c9\u304c\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u3067\u8868\u793a\u3055\u308c\u308b\u753b\u9762\u3002<\/li>\n<\/ol>\n\n\n\n<p>\u3053\u3053\u3067\u3001\u691c\u7d22\u7a93\u306b\u6587\u5b57\u3092\u5165\u529b\u3057\u305f\u308a\u3001\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u305f\u308a\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002\u3042\u306a\u305f\u52d5\u3044\u305f\u3068\u304a\u308a\u306b\u3001Inspector\u753b\u9762\u306b\u30b3\u30fc\u30c9\u304c\u3069\u3093\u3069\u3093\u8ffd\u8a18\u3055\u308c\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u30b9\u30c6\u30c3\u30d73\uff1a\u30b3\u30fc\u30c9\u3092\u30b3\u30d4\u30fc\u3057\u3066\u5b8c\u4e86<\/h4>\n\n\n\n<p>\u64cd\u4f5c\u304c\u7d42\u308f\u3063\u305f\u3089\u3001Inspector\u753b\u9762\u306e\u30b3\u30fc\u30c9\u3092\u30b3\u30d4\u30fc\uff08\u307e\u305f\u81ea\u52d5\u4fdd\u5b58\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u78ba\u8a8d\uff09\u3059\u308b\u3060\u3051\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u751f\u6210\u3055\u308c\u308b\u30b3\u30fc\u30c9\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u975e\u5e38\u306b\u8aad\u307f\u3084\u3059\u304f\u3001\u30e2\u30c0\u30f3\u306a\u66f8\u304d\u65b9\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-python\" data-lang=\"Python\"><code>from playwright.sync_api import Playwright, sync_playwright\n\ndef run(playwright: Playwright) -&gt; None:\n    browser = playwright.chromium.launch(headless=False)\n    context = browser.new_context()\n    page = context.new_page()\n    \n    # \u6307\u5b9a\u3057\u305fURL\u3078\u30a2\u30af\u30bb\u30b9\n    page.goto(&quot;https:\/\/www.python.org\/&quot;)\n    \n    # \u691c\u7d22\u7a93\u3092\u30af\u30ea\u30c3\u30af\uff08\u81ea\u52d5\u751f\u6210\u3055\u308c\u305f\u30ed\u30b1\u30fc\u30bf\uff09\n    page.get_by_placeholder(&quot;Search&quot;).click()\n    \n    # &quot;playwright&quot; \u3068\u5165\u529b\n    page.get_by_placeholder(&quot;Search&quot;).fill(&quot;playwright&quot;)\n    \n    # \u691c\u7d22\u5b9f\u884c\uff08Enter\u30ad\u30fc\uff09\n    page.get_by_placeholder(&quot;Search&quot;).press(&quot;Enter&quot;)\n\n    # \u30d6\u30e9\u30a6\u30b6\u3092\u9589\u3058\u308b\n    context.close()\n    browser.close()\n\nwith sync_playwright() as playwright:\n    run(playwright)<\/code><\/pre><\/div>\n\n\n\n<p>\u3054\u89a7\u306e\u901a\u308a\u3001<code>get_by_placeholder(\"Search\")<\/code>\u306e\u3088\u3046\u306b\u3001\u4eba\u9593\u304c\u898b\u3066\u610f\u5473\u304c\u308f\u304b\u308b\u30ed\u30b1\u30fc\u30bf\u304c\u81ea\u52d5\u3067\u9078\u3070\u308c\u3066\u3044\u307e\u3059\u3002Selenium\u306e\u3088\u3046\u306b\u610f\u5473\u4e0d\u660e\u306a<code>div&gt;span:nth-child(3)<\/code>\u306e\u3088\u3046\u306a\u30bb\u30ec\u30af\u30bf\u3092\u624b\u66f8\u304d\u3059\u308b\u5fc5\u8981\u306f\u3001\u3082\u3046\u4e8c\u5ea6\u3068\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Playwright\u3068Selenium\u306e\u5fb9\u5e95\u6bd4\u8f03\u8868<\/h2>\n\n\n\n<p>\u3053\u3053\u307e\u3067\u306e\u5185\u5bb9\u3092\u8e0f\u307e\u3048\u3001Selenium\u3068Playwright\u306e\u6a5f\u80fd\u3084\u7279\u5fb4\u3092\u6bd4\u8f03\u8868\u306b\u307e\u3068\u3081\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u3069\u3061\u3089\u3082\u7d20\u6674\u3089\u3057\u3044\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3059\u304c\u300c\u958b\u767a\u52b9\u7387\u300d\u3068\u300c\u5b9f\u884c\u306e\u5b89\u5b9a\u6027\u300d\u306b\u304a\u3044\u3066\u3001Playwright\u304c\u5727\u5012\u3057\u3066\u3044\u308b\u3053\u3068\u304c\u4e00\u76ee\u3067\u308f\u304b\u308a\u307e\u3059\u3002<\/p>\n\n\n<div class=\"c-scrollHint sp_\"><span>\u30b9\u30af\u30ed\u30fc\u30eb\u3067\u304d\u307e\u3059 <i class=\"icon-more_arrow\"><\/i><\/span><\/div>\n<figure data-table-scrollable=\"sp\" class=\"wp-block-table min_width20_\"><table style=\"--table-width:800px;\" class=\"has-fixed-layout\"><thead style=\"--thead-color--bg:var(--color_deep02);--thead-color--txt:var(--swl-text_color--white)\"><tr><th>\u6bd4\u8f03\u9805\u76ee<\/th><th>Selenium<\/th><th>Playwright<\/th><\/tr><\/thead><tbody><tr><td>\u5f85\u6a5f\u51e6\u7406<\/td><td>\u624b\u52d5<br>\uff08time.sleep\u3084Explicit Wait\u306e\u8a18\u8ff0\u304c\u5fc5\u9808\u3002\u8abf\u6574\u304c\u30b7\u30d3\u30a2\uff09<\/td><td>\u5b8c\u5168\u81ea\u52d5 Auto-wait<br>\uff08\u8981\u7d20\u306e\u8868\u793a\u3084\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3092\u81ea\u52d5\u691c\u77e5\u30fb\u8a18\u8ff0\u4e0d\u8981\uff09<\/td><\/tr><tr><td>\u74b0\u5883\u69cb\u7bc9<\/td><td>\u9762\u5012<br>\uff08\u30d6\u30e9\u30a6\u30b6\u3068WebDriver\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u4e00\u81f4\u7ba1\u7406\u304c\u5fc5\u8981\uff09<\/td><td>\u8d85\u7c21\u5358<br>\uff08\u30b3\u30de\u30f3\u30c92\u3064\u3067\u5c02\u7528\u30d6\u30e9\u30a6\u30b6\u3092\u4e00\u62ec\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\uff09<\/td><\/tr><tr><td>\u30b3\u30fc\u30c9\u4f5c\u6210<\/td><td>\u624b\u52d5<br>\uff08\u30c7\u30d9\u30ed\u30c3\u30d1\u30fc\u30c4\u30fc\u30eb\u306e\u691c\u8a3c\u6a5f\u80fd\u3068\u30a8\u30c7\u30a3\u30bf\u3092\u5f80\u5fa9\uff09<\/td><td>\u81ea\u52d5\u751f\u6210 codegen<br>\uff08\u30d6\u30e9\u30a6\u30b6\u64cd\u4f5c\u3092\u9332\u753b\u3059\u308b\u3060\u3051\u3067\u30b3\u30fc\u30c9\u304c\u5b8c\u6210\uff09<\/td><\/tr><tr><td>\u5b9f\u884c\u901f\u5ea6<\/td><td>\u666e\u901a\uff5e\u9045\u3044<br>\uff08\u7121\u99c4\u306a\u5f85\u6a5f\u6642\u9593\u304c\u767a\u751f\u3057\u3084\u3059\u304f\u3001\u8d77\u52d5\u3082\u91cd\u3081\uff09<\/td><td>\u9ad8\u901f<br>\uff08\u6700\u9069\u5316\u3055\u308c\u305f\u5f85\u6a5f\u51e6\u7406\u3068\u8efd\u91cf\u306a\u8d77\u52d5\u30d7\u30ed\u30bb\u30b9\uff09<\/td><\/tr><tr><td>\u60c5\u5831\u91cf\u30fb\u6b74\u53f2<\/td><td>\u975e\u5e38\u306b\u591a\u3044<br>\uff0810\u5e74\u4ee5\u4e0a\u306e\u6b74\u53f2\u304c\u3042\u308a\u3001\u65e5\u672c\u8a9e\u60c5\u5831\u3082\u8c4a\u5bcc\uff09<\/td><td>\u3084\u3084\u5c11\u306a\u3044<br>\uff08\u65b0\u8208\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u305f\u3081\u3001Selenium\u307b\u3069\u8cc7\u7523\u306f\u591a\u304f\u306a\u3044\uff09<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Playwright\u306e\u5f31\u70b9\u3068\u4eca\u5f8c\u306e\u5c55\u671b<\/h3>\n\n\n\n<p>\u3053\u3053\u307e\u3067Playwright\u3092\u7d76\u8cdb\u3057\u3066\u304d\u307e\u3057\u305f\u304c\u3001\u30d5\u30a7\u30a2\u306a\u6bd4\u8f03\u306e\u305f\u3081\u306b\u3001\u73fe\u6642\u70b9\u3067Selenium\u306b\u52a3\u308b\u70b9\u3001\u3059\u306a\u308f\u3061\u300c\u5f31\u70b9\u300d\u306b\u3064\u3044\u3066\u3082\u6b63\u76f4\u306b\u304a\u4f1d\u3048\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u305d\u308c\u306f\u300c\u6b74\u53f2\u306e\u6d45\u3055\u3086\u3048\u306e\u60c5\u5831\u91cf\u3068\u30a8\u30b3\u30b7\u30b9\u30c6\u30e0\u306e\u5dee\u300d\u3067\u3059\u3002<\/p>\n\n\n\n<p>Selenium\u306f\u9577\u5e74\u4f7f\u308f\u308c\u3066\u304d\u305f\u305f\u3081\u3001\u56f0\u3063\u305f\u3068\u304d\u306b\u691c\u7d22\u3059\u308c\u3070\u65e5\u672c\u8a9e\u306e\u89e3\u6c7a\u7b56\u304c\u5c71\u306e\u3088\u3046\u306b\u51fa\u3066\u304d\u307e\u3059\u3002\u307e\u305fSelenium\u3092\u62e1\u5f35\u3059\u308b\u30b5\u30fc\u30c9\u30d1\u30fc\u30c6\u30a3\u88fd\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3084\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u3082\u5de8\u5927\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u4e00\u65b9\u3067Playwright\u306f\u6bd4\u8f03\u7684\u65b0\u3057\u3044\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3042\u308b\u305f\u3081\u3001Selenium\u306b\u6bd4\u3079\u308b\u3068\u65e5\u672c\u8a9e\u306e\u60c5\u5831\u306f\u307e\u3060\u5c11\u306a\u3081\u3067\u3059\u3002\u300c\u5b66\u7fd2\u30b3\u30b9\u30c8\u304c\u3084\u3084\u9ad8\u3044\u300d\u3068\u611f\u3058\u308b\u5834\u9762\u304c\u3042\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002\u307e\u305f\u72ec\u81ea\u306e\u95a2\u9023\u30e9\u30a4\u30d6\u30e9\u30ea\u3068\u3044\u3063\u305f\u30a8\u30b3\u30b7\u30b9\u30c6\u30e0\u3082\u3001Selenium\u307b\u3069\u306f\u6210\u719f\u3057\u3066\u3044\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<p>\u3057\u304b\u3057\u3001\u3053\u308c\u306f\u6642\u9593\u306e\u554f\u984c\u3067\u89e3\u6c7a\u3055\u308c\u308b\u3067\u3057\u3087\u3046\u3002<\/p>\n\n\n<div class=\"swell-block-balloon\"><div class=\"c-balloon -bln-left\" data-col=\"green\"><div class=\"c-balloon__icon -circle\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/nao-kun.com\/wp-content\/uploads\/2025\/09\/\u65b0\u306a\u304a\u304f\u3093-150x150.png\" alt=\"\" class=\"c-balloon__iconImg\" width=\"80px\" height=\"80px\"><span class=\"c-balloon__iconName\">\u306a\u304a\u304f\u3093<\/span><\/div><div class=\"c-balloon__body -speaking -border-none\"><div class=\"c-balloon__text\">\n<p>\u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u304c\u975e\u5e38\u306b\u5145\u5b9f\u3057\u3066\u3044\u308b\u305f\u3081\u3001\u6163\u308c\u308c\u3070\u60c5\u5831\u4e0d\u8db3\u3067\u56f0\u308b\u3053\u3068\u306f\u307b\u307c\u3042\u308a\u307e\u305b\u3093\u3002\u4f55\u3088\u308a\u3001\u3053\u306e\u5727\u5012\u7684\u306a\u5229\u4fbf\u6027\u3092\u77e5\u3063\u305f\u30a8\u30f3\u30b8\u30cb\u30a2\u305f\u3061\u304c\u3001\u4eca\u307e\u3055\u306b\u731b\u30b9\u30d4\u30fc\u30c9\u3067Playwright\u306b\u79fb\u884c\u3057\u3066\u3044\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<span class=\"c-balloon__shapes\"><span class=\"c-balloon__before\"><\/span><span class=\"c-balloon__after\"><\/span><\/span><\/div><\/div><\/div><\/div>\n\n\n<p>\u30b7\u30a7\u30a2\u306e\u62e1\u5927\u3068\u3068\u3082\u306b\u3001\u60c5\u5831\u91cf\u3084\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u306e\u5dee\u306f\u6025\u901f\u306b\u7e2e\u307e\u3063\u3066\u3044\u307e\u3059\u3002\u4eca\u304b\u3089\u5b66\u3076\u306e\u3067\u3042\u308c\u3070\u3001\u5c06\u6765\u6027\u3068\u3044\u3046\u89b3\u70b9\u3067\u3082Playwright\u306b\u6295\u8cc7\u3059\u308b\u306e\u304c\u8ce2\u660e\u306a\u5224\u65ad\u3067\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Python\u3067Playwright\u3092\u59cb\u3081\u308b\u305f\u3081\u306e\u5168\u624b\u9806<\/h2>\n\n\n\n<p>\u305d\u308c\u3067\u306f\u3001\u5b9f\u969b\u306bPython\u3067Playwright\u3092\u52d5\u304b\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002\u624b\u9806\u306f\u975e\u5e38\u306b\u30b7\u30f3\u30d7\u30eb\u3067\u3001Selenium\u306e\u3088\u3046\u306a\u8907\u96d1\u306a\u30c9\u30e9\u30a4\u30d0\u8a2d\u5b9a\u306f\u4e00\u5207\u4e0d\u8981\u3067\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2\u30b9\u30c6\u30c3\u30d7\u3067\u5b8c\u4e86\u3059\u308b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n\n\n\n<div class=\"swell-block-step\" data-num-style=\"circle\">\n<div class=\"swell-block-step__item\"><div class=\"swell-block-step__number u-bg-main\"><span class=\"__label\">STEP<\/span><\/div><div class=\"swell-block-step__title u-fz-l\">\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/div><div class=\"swell-block-step__body\">\n<p>\u307e\u305a<code>pip<\/code>\u3092\u4f7f\u3063\u3066\u3001Playwright\u672c\u4f53\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pip install playwright<\/code><\/pre>\n<\/div><\/div>\n\n\n\n<div class=\"swell-block-step__item\"><div class=\"swell-block-step__number u-bg-main\"><span class=\"__label\">STEP<\/span><\/div><div class=\"swell-block-step__title u-fz-l\">\u30d6\u30e9\u30a6\u30b6\u30d0\u30a4\u30ca\u30ea\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/div><div class=\"swell-block-step__body\">\n<p>\u6b21\u306b\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308aPlaywright\u304c\u5236\u5fa1\u3059\u308b\u305f\u3081\u306e\u5c02\u7528\u30d6\u30e9\u30a6\u30b6\uff08Chromium, Firefox, WebKit\uff09\u304c\u4e00\u62ec\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>playwright install<\/code><\/pre>\n<\/div><\/div>\n<\/div>\n\n\n\n<p>\u305f\u3063\u305f\u3053\u308c\u3060\u3051\u3067\u3001\u74b0\u5883\u69cb\u7bc9\u306f\u5b8c\u4e86\u3067\u3059\u3002\u30d1\u30b9\u3092\u901a\u3057\u305f\u308a\u3001\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u6c17\u306b\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u57fa\u672c\u7684\u306a\u30b3\u30fc\u30c9\u306e\u66f8\u304d\u65b9\u3068\u300c\u30ed\u30b1\u30fc\u30bf\u300d<\/h3>\n\n\n\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u3067\u304d\u305f\u3089\u3001\u5b9f\u969b\u306b\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u3092\u884c\u3046\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u307f\u307e\u3057\u3087\u3046\u3002\u3053\u3053\u3067\u306f\u3001Google\u3067\u691c\u7d22\u3092\u884c\u3046\u7c21\u5358\u306a\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-python\" data-lang=\"Python\"><code>from playwright.sync_api import sync_playwright\n\ndef run():\n    with sync_playwright() as p:\n        # \u30d6\u30e9\u30a6\u30b6\u3092\u8d77\u52d5\uff08headless=False\u3067\u753b\u9762\u3092\u8868\u793a\uff09\n        browser = p.chromium.launch(headless=False)\n        page = browser.new_page()\n\n        # Google\u306b\u30a2\u30af\u30bb\u30b9\n        page.goto(&quot;https:\/\/www.google.com\/&quot;)\n\n        # \u3010\u30ed\u30b1\u30fc\u30bf\u3011\u691c\u7d22\u30dc\u30c3\u30af\u30b9\u3092\u898b\u3064\u3051\u3066\u5165\u529b\u3092\u3059\u308b\n        # \u30e6\u30fc\u30b6\u30fc\u306b\u898b\u3048\u3066\u3044\u308b\u300c\u30e9\u30d9\u30eb\u300d\u3084\u300c\u30d7\u30ec\u30fc\u30b9\u30db\u30eb\u30c0\u30fc\u300d\u3067\u6307\u5b9a\u53ef\u80fd\n        page.get_by_label(&quot;\u691c\u7d22&quot;).fill(&quot;Playwright Python&quot;)\n\n        # Enter\u30ad\u30fc\u3092\u62bc\u3059\uff08\u691c\u7d22\u5b9f\u884c\uff09\n        page.keyboard.press(&quot;Enter&quot;)\n\n        # \u691c\u7d22\u7d50\u679c\u304c\u8868\u793a\u3055\u308c\u308b\u306e\u3092\u81ea\u52d5\u3067\u5f85\u6a5f\u3057\u3001\u30bf\u30a4\u30c8\u30eb\u3092\u53d6\u5f97\n        # Auto-wait\u6a5f\u80fd\u306b\u3088\u308a\u3001time.sleep()\u306f\u4e0d\u8981\uff01\n        page.locator(&quot;#search&quot;).wait_for()\n        print(page.title())\n\n        # \u30d6\u30e9\u30a6\u30b6\u3092\u9589\u3058\u308b\n        browser.close()\n\nif __name__ == &quot;__main__&quot;:\n    run()<\/code><\/pre><\/div>\n\n\n\n<p>\u3053\u306e\u30b3\u30fc\u30c9\u306e\u4e2d\u3067\u3001\u305c\u3072\u6ce8\u76ee\u3057\u3066\u3044\u305f\u3060\u304d\u305f\u3044\u306e\u304c\u300c\u30ed\u30b1\u30fc\u30bf\u300d\u3068\u3044\u3046\u6982\u5ff5\u3067\u3059\u3002<\/p>\n\n\n\n<div class=\"swell-block-capbox cap_box is-style-onborder_ttl2\"><div class=\"cap_box_ttl\"><span>\u30ed\u30b1\u30fc\u30bf\u3068\u306f\uff1f<\/span><\/div><div class=\"cap_box_content\">\n<p>\u4e00\u8a00\u3067\u8a00\u3048\u3070\u300c\u8981\u7d20\u3092\u898b\u3064\u3051\u308b\u305f\u3081\u306e\u3001\u3088\u308a\u8ce2\u304f\u3066\u58ca\u308c\u306b\u304f\u3044\u691c\u7d22\u65b9\u6cd5\u300d\u3067\u3059\u3002Selenium\u3067\u306f<code>Xpath<\/code>\u3084<code>CSS Selector<\/code>\u3092\u4f7f\u3063\u3066\u300cHTML\u306e\u69cb\u9020\u300d\u3067\u6307\u5b9a\u3057\u3066\u3044\u307e\u3057\u305f\u304c\u3001Playwright\u306e\u30ed\u30b1\u30fc\u30bf\u306f\u300c\u30e6\u30fc\u30b6\u30fc\u306b\u898b\u3048\u3066\u3044\u308b\u6587\u5b57\u300d\u3084\u300c\u30e9\u30d9\u30eb\u300d\u3067\u8981\u7d20\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3092\u63a8\u5968\u3057\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u30b5\u30a4\u30c8\u306e\u30c7\u30b6\u30a4\u30f3\u304c\u591a\u5c11\u5909\u308f\u3063\u3066\u3082\u3001\u30b3\u30fc\u30c9\u304c\u52d5\u304b\u306a\u304f\u306a\u308b\u30ea\u30b9\u30af\u3092\u5287\u7684\u306b\u6e1b\u3089\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<\/div><\/div>\n\n\n\n<p>\u56f0\u3063\u3068\u304d\u306e\u300c\u30c8\u30ec\u30fc\u30b9\u30d3\u30e5\u30fc\u30a2\u300d<\/p>\n\n\n\n<p>\u6700\u5f8c\u306b\u958b\u767a\u4e2d\u306b\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u969b\u306e\u5f37\u529b\u306a\u5473\u65b9\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"swell-block-capbox cap_box is-style-onborder_ttl2\"><div class=\"cap_box_ttl\"><span>\u30c8\u30ec\u30fc\u30b9\u30d3\u30e5\u30fc\u30a2<\/span><\/div><div class=\"cap_box_content\">\n<p>\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u306e\u5b9f\u884c\u904e\u7a0b\u3092\u8a18\u9332\u3057\u3001\u3042\u3068\u304b\u3089\u300c\u30bf\u30a4\u30e0\u30de\u30b7\u30f3\u306e\u3088\u3046\u306b\u518d\u751f\u3067\u304d\u308b\u30c7\u30d0\u30c3\u30b0\u6a5f\u80fd\u300d\u3067\u3059\u3002\u300c\u3069\u3053\u304b\u3067\u30af\u30ea\u30c3\u30af\u3057\u305f\u304b\u300d\u300c\u305d\u306e\u6642\u753b\u9762\u306f\u3069\u3046\u306a\u3063\u3066\u3044\u305f\u304b\u300d\u300c\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u901a\u4fe1\u306f\u4f55\u304c\u884c\u308f\u308c\u3066\u3044\u305f\u304b\u300d\u3092\u3001\u6642\u7cfb\u5217\u3067\u8a73\u7d30\u306b\u632f\u308a\u8fd4\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u308c\u3092\u4f7f\u3048\u3070\u3001\u30a8\u30e9\u30fc\u306e\u539f\u56e0\u7279\u5b9a\u306b\u304b\u304b\u308b\u6642\u9593\u3092\u5927\u5e45\u306b\u77ed\u7e2e\u3067\u304d\u307e\u3059\u3002<\/p>\n<\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">\u307e\u3068\u3081\uff1a\u4eca\u3059\u3050Selenium\u3092\u6368\u3066\u3066\u3001Playwright\u3078\u79fb\u884c\u3057\u3088\u3046<\/h2>\n\n\n\n<p>\u672c\u8a18\u4e8b\u3067\u306f\u3001Selenium\u306e\u9650\u754c\u3068\u3001\u305d\u308c\u3092\u89e3\u6c7a\u3059\u308bPlaywright\u306e\u5727\u5012\u7684\u306a\u30e1\u30ea\u30c3\u30c8\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u6539\u3081\u3066\u3001Playwright\u3092\u5c0e\u5165\u3059\u3079\u304d\u7406\u7531\u3092\u6574\u7406\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5f85\u6a5f\u51e6\u7406\u304b\u3089\u306e\u89e3\u653e\uff1a<code>time.sleep()<\/code>\u6642\u523b\u306b\u30b5\u30e8\u30ca\u30e9\u3002Auto-wait\u304c\u5b89\u5b9a\u52d5\u4f5c\u3092\u4fdd\u8a3c\u3057\u307e\u3059\u3002<\/li>\n\n\n\n<li>\u958b\u767a\u901f\u5ea6\u306e\u7206\u5897\uff1a<code>codegen<\/code>\u3092\u4f7f\u3048\u3070\u3001\u30d6\u30e9\u30a6\u30b6\u3092\u64cd\u4f5c\u3059\u308b\u3060\u3051\u3067\u30b3\u30fc\u30c9\u304c\u5b8c\u6210\u3057\u307e\u3059\u3002<\/li>\n\n\n\n<li>\u74b0\u5883\u69cb\u7bc9\u306e\u7c21\u7565\u5316\uff1a\u30b3\u30de\u30f3\u30c92\u767a\u3067\u6e96\u5099\u5b8c\u4e86\u3002WebDriver\u306e\u7ba1\u7406\u30b3\u30b9\u30c8\u306f\u30bc\u30ed\u3067\u3059\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u79c1\u81ea\u8eab\u3001\u9577\u5e74Selenium\u3092\u4f7f\u3063\u3066\u304d\u307e\u3057\u305f\u304c\u3001Playwright\u306b\u79fb\u884c\u3057\u3066\u304b\u3089\u306f\u3001\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u306e\u5b9f\u88c5\u306b\u304b\u304b\u308b\u6642\u9593\u304c\u534a\u5206\u4ee5\u4e0b\u306b\u306a\u308a\u307e\u3057\u305f\u3002\u4f55\u3088\u308a\u300c\u3044\u3064\u30a8\u30e9\u30fc\u3067\u6b62\u307e\u308b\u304b\u308f\u304b\u3089\u306a\u3044\u300d\u3068\u3044\u3046\u30b9\u30c8\u30ec\u30b9\u304b\u3089\u89e3\u653e\u3055\u308c\u305f\u3053\u3068\u304c\u3001\u6700\u5927\u306e\u30e1\u30ea\u30c3\u30c8\u3060\u3068\u611f\u3058\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3082\u3057\u3042\u306a\u305f\u304c\u3001\u4eca\u3082Selenium\u306e\u8abf\u6574\u306b\u6642\u9593\u3092\u8cbb\u3084\u3057\u3066\u3044\u308b\u306e\u306a\u3089\u3001\u305d\u308c\u306f\u975e\u5e38\u306b\u3082\u3063\u305f\u3044\u306a\u3044\u3053\u3068\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u4eca\u3059\u3050Playwright\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3001\u3042\u306e\u5feb\u9069\u306a<code>codegen<\/code>\u6a5f\u80fd\u3092\u4f53\u9a13\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002\u3082\u3046\u4e8c\u5ea6\u3068\u3001Selenium\u306b\u306f\u623b\u308c\u306a\u304f\u306a\u308b\u306f\u305a\u3067\u3059\u3002<\/p>\n\n\n\n\n","protected":false},"excerpt":{"rendered":"<p>\u300c\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u306e\u5f85\u3061\u6642\u9593\u3092\u8003\u616e\u3057\u3066time.sleep()\u3092\u5165\u308c\u305f\u306e\u306b\u3001\u8aad\u307f\u8fbc\u307f\u304c\u9045\u308c\u3066\u30a8\u30e9\u30fc\u306b\u306a\u3063\u305f\u300d \u304b\u3068\u8a00\u3063\u3066\u9577\u3081\u306b\u5f85\u3061\u6642\u9593\u3092\u8a2d\u5b9a\u3059\u308b\u3068\u3001\u4eca\u5ea6\u306f\u51e6\u7406\u5168\u4f53\u306e\u30b9\u30d4\u30fc\u30c9\u304c\u9045\u304f\u306a\u3063\u3066\u30a4\u30e9\u30a4\u30e9\u3059\u308b&#8230; Python [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3041,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","footnotes":""},"categories":[10,9],"tags":[],"class_list":["post-2901","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","category-programming"],"_links":{"self":[{"href":"https:\/\/nao-kun.com\/index.php?rest_route=\/wp\/v2\/posts\/2901","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nao-kun.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nao-kun.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nao-kun.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nao-kun.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2901"}],"version-history":[{"count":137,"href":"https:\/\/nao-kun.com\/index.php?rest_route=\/wp\/v2\/posts\/2901\/revisions"}],"predecessor-version":[{"id":3040,"href":"https:\/\/nao-kun.com\/index.php?rest_route=\/wp\/v2\/posts\/2901\/revisions\/3040"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nao-kun.com\/index.php?rest_route=\/wp\/v2\/media\/3041"}],"wp:attachment":[{"href":"https:\/\/nao-kun.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2901"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nao-kun.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2901"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nao-kun.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2901"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}