{"id":21093,"date":"2023-06-06T23:38:52","date_gmt":"2023-06-06T14:38:52","guid":{"rendered":"http:\/\/www.code-magagine.com\/?p=21093"},"modified":"2023-06-11T12:33:55","modified_gmt":"2023-06-11T03:33:55","slug":"%e3%80%90python%e3%80%91%e3%82%b9%e3%82%af%e3%83%ac%e3%82%a4%e3%83%94%e3%83%b3%e3%82%b0%e3%83%97%e3%83%ad%e3%82%b0%e3%83%a9%e3%83%a0%e3%81%ae%e7%b4%b0%e3%81%8b%e3%81%84%e9%85%8d%e6%85%ae","status":"publish","type":"post","link":"http:\/\/www.code-magagine.com\/?p=21093","title":{"rendered":"\u3010Python\u3011\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u5b9f\u88c5\u6642\u306e\u7d30\u304b\u3044\u914d\u616e"},"content":{"rendered":"<h2>\u30ed\u30b0\u30a4\u30f3\u753b\u9762<\/h2>\n<p>\u30ed\u30b0\u30a4\u30f3\u753b\u9762\u306f\u901a\u5e38\u306e\u5165\u529b\u3068\u7570\u306a\u308aCSRF\u30c8\u30fc\u30af\u30f3\u3092POST\u30ea\u30af\u30a8\u30b9\u30c8\u306b\u5408\u308f\u305b\u3066\u9001\u4fe1\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u30ed\u30b0\u30a4\u30f3\u51e6\u7406\u304c\u5fc5\u8981\u306aWeb\u30a2\u30d7\u30ea\u306e\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u306e\u5834\u5408\u306f\u3001CSRF\u30c8\u30fc\u30af\u30f3\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308binput\u8981\u7d20\u304b\u3089CSRF\u30c8\u30fc\u30af\u30f3\u3092\u53d6\u5f97\u3057\u3066\u9001\u4fe1\u3059\u308b\u3088\u3046\u306b\u5b9f\u88c5\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>CSRF\u30c8\u30fc\u30af\u30f3\u306f\u3001form\u306ehidden\u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u57cb\u3081\u8fbc\u307e\u308c\u3066\u3044\u308b\u3053\u3068\u304c\u591a\u3044\u306e\u3067form\u306ehidden\u8981\u7d20\u3092Xpath\u304bCSS\u30bb\u30ec\u30af\u30bf\u306a\u3069\u3067\u7279\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<h2>\u8981\u7d20\u306e\u7d5e\u308a\u8fbc\u307f\u65b9<\/h2>\n<h3>id\u5c5e\u6027\u3092\u6301\u3063\u3066\u3044\u308b\u306a\u3089\u7a4d\u6975\u7684\u306b\u5229\u7528\u3059\u308b<\/h3>\n<p>HTML\u306eid\u5c5e\u6027\u306f\u305d\u306eHTML\u3067\u306f\u5fc5\u305a\u4e00\u610f\u306a\u8981\u7d20\u306b\u306a\u308b\u306e\u3067\u3082\u3057\u6301\u3063\u3066\u3044\u305f\u3089\u7a4d\u6975\u7684\u306b\u6d3b\u7528\u3057\u307e\u3057\u3087\u3046\u3002\u305f\u3060\u3001\u6700\u8fd1\u306fclass\u3060\u3051\u5229\u7528\u3057\u3066\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3092\u3059\u308b\u3068\u3044\u3046\u8a2d\u8a08\u306b\u306a\u3063\u3066\u3044\u308b\u30b5\u30a4\u30c8\u304c\u591a\u3044\u306e\u3067\u3042\u304f\u307e\u3067\u30e9\u30c3\u30ad\u30fc\u7a0b\u5ea6\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h2>\u30c7\u30fc\u30bf\u6574\u5f62<\/h2>\n<h3>\u53d6\u5f97\u30c7\u30fc\u30bf\u304c\u6539\u884c\u304c\u542b\u307e\u308c\u3066\u3044\u308b\u30b1\u30fc\u30b9\u304c\u3042\u308b\u3002<\/h3>\n<p>\u4f8b\u3048\u3070\u3001\u30bf\u30a4\u30c8\u30eb\u3092\u53d6\u5f97\u3057\u305f\u3044\u3068\u601d\u3063\u3066\u3082\u30bf\u30a4\u30c8\u30eb\u306b\u6539\u884c\u304c\u542b\u307e\u308c\u3066\u3044\u308b\u30b1\u30fc\u30b9\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<h4>Scrapy\u306e\u5834\u5408<\/h4>\n<p>getAll\u3067\u914d\u5217\u3068\u3057\u3066\u53d6\u5f97\u3057\u3066Python\u306ejoin\u30e1\u30bd\u30c3\u30c9\u3067\u534a\u89d2\u30b9\u30da\u30fc\u30b9\u3092\u958b\u3051\u3066\u8fd4\u3059\u30e1\u30bd\u30c3\u30c9\u3092\u4f5c\u3063\u3066\u7d50\u5408\u3057\u307e\u3059\u3002<\/p>\n<h3>\u53d6\u5f97\u3057\u3066\u3044\u308b\u30c7\u30fc\u30bf\u306e\u5148\u982d\u3084\u672b\u5c3e\u306b\u7a7a\u767d\u304c\u542b\u307e\u308c\u3066\u3044\u308b\u30b1\u30fc\u30b9\u304c\u3042\u308b\u3002<\/h3>\n<h4>XPath\u3092\u4f7f\u3063\u3066\u3044\u308b\u5834\u5408<\/h4>\n<p>normalize-space\u3067Xpath\u3092\u56f2\u3063\u3066\u3042\u3052\u308b\u3053\u3068\u3067\u5148\u982d\u3084\u672b\u5c3e\u306e\u30b9\u30da\u30fc\u30b9\u3092\u9664\u53bb\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">'normalize-space(\/\/h3\/text())'<\/pre>\n<h4>XPath\u3092\u4f7f\u3063\u3066\u3044\u306a\u3044\u5834\u5408\uff08\u4f8b\u3048\u3070\u3001CSS\u30bb\u30ec\u30af\u30bf\u3067\u53d6\u5f97\u3059\u308b\u5834\u5408\uff09<\/h4>\n<p>Python\u306estrip\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3046\u3002\u5148\u982d\u3084\u672b\u5c3e\u306e\u30b9\u30da\u30fc\u30b9\u3092\u53d6\u308a\u9664\u3051\u307e\u3059\u3002<\/p>\n<h3>\u6570\u5024\u304c\u6587\u5b57\u5217\u3068\u3057\u3066\u53d6\u5f97\u3055\u308c\u3066\u304d\u3066\u3057\u307e\u3046\u3002<\/h3>\n<p>\u4f8b\u3048\u3070\u3001\u91d1\u984d\u306a\u3069\u306e\u9805\u76ee\u3067\u3059\u3002\u5f8c\u3067\u6570\u5024\u3068\u3057\u3066\u51e6\u7406\u3057\u305f\u3044\u306e\u306b\u6587\u5b57\u5217\u306e\u307e\u307e\u306b\u306a\u3063\u3066\u3044\u308b\u3068\u4e0d\u4fbf\u3067\u3059\u3002<\/p>\n<p>\u6574\u5f62\u3059\u308b\u30e1\u30bd\u30c3\u30c9\u3092\u4f5c\u3063\u3066\u3042\u3052\u308b\u3088\u3046\u306b\u3057\u307e\u3057\u3087\u3046\u3002\u5177\u4f53\u7684\u306b\u306f\u4f8b\u3048\u3070\u91d1\u984d\u3067\u3042\u308c\u3070\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u52a0\u5de5\u51e6\u7406\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<ul>\n<li>\u00a5\u3092repalce\u3067\u7f6e\u63db\u3059\u308b\u3002<\/li>\n<li>,\u3092replace\u3067\u7f6e\u63db\u3059\u308b\u3002<\/li>\n<li>int\u3067\u6570\u5024\u578b\u306b\u5909\u63db\u3059\u308b\u3002<\/li>\n<\/ul>\n<h2>\u4e26\u3073\u9806\u3092\u8003\u616e\u3059\u308b<\/h2>\n<h3>Scrapy\u306e\u5834\u5408<\/h3>\n<p>Scrapy\u3060\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u306b\u306a\u3063\u3066\u304a\u308a\u610f\u56f3\u3057\u305f\u9806\u756a\u306b\u306a\u3089\u306a\u3044\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u8907\u6570\u540c\u6642\u306b\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u51e6\u7406\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308b\u3002<\/li>\n<li>LIFO\u306e\u65b9\u5f0f\u3092\u3068\u3063\u3066\u304a\u308a\u3001\u4e26\u3073\u9806\u3067\u51e6\u7406\u3055\u308c\u308b\u3053\u3068\u304c\u306a\u3044\u3002<\/li>\n<\/ul>\n<p>Scrapy\u3067\u306f\u4fdd\u7559\u4e2d\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u4fdd\u5b58\u3059\u308b\u305f\u3081\u306bLIFO\u00a0\u30ad\u30e5\u30fc<em>\u3092<\/em>\u5229\u7528\u3057\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"\u30ed\u30b0\u30a4\u30f3\u753b\u9762 \u30ed\u30b0\u30a4\u30f3\u753b\u9762\u306f\u901a\u5e38\u306e\u5165\u529b\u3068\u7570\u306a\u308aCSRF\u30c8\u30fc\u30af\u30f3\u3092POST\u30ea\u30af\u30a8\u30b9\u30c8\u306b\u5408\u308f\u305b\u3066\u9001\u4fe1\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u30ed\u30b0\u30a4\u30f3\u51e6\u7406\u304c\u5fc5\u8981\u306aWeb\u30a2\u30d7\u30ea\u306e\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u306e\u5834\u5408\u306f\u3001CSRF\u30c8\u30fc\u30af\u30f3\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308binput\u8981\u7d20 [&hellip;]","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[47],"tags":[],"_links":{"self":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/21093"}],"collection":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=21093"}],"version-history":[{"count":12,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/21093\/revisions"}],"predecessor-version":[{"id":21237,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/21093\/revisions\/21237"}],"wp:attachment":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=21093"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=21093"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=21093"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}