{"id":69365,"date":"2018-08-27T14:06:07","date_gmt":"2018-08-27T05:06:07","guid":{"rendered":"https:\/\/www.sejuku.net\/blog\/?p=69365"},"modified":"2024-05-06T11:51:02","modified_gmt":"2024-05-06T02:51:02","slug":"%e3%80%90python%e5%85%a5%e9%96%80%e3%80%91xpath%e3%81%a7%e3%82%b9%e3%82%af%e3%83%ac%e3%82%a4%e3%83%94%e3%83%b3%e3%82%b0%e3%82%92%e3%81%97%e3%82%88%e3%81%86","status":"publish","type":"post","link":"https:\/\/www.sejuku.net\/blog\/69365","title":{"rendered":"\u3010Python\u5165\u9580\u3011XPath\u3067\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u3059\u308b\u624b\u9806\u3092\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\uff01"},"content":{"rendered":"\n<p>\u3053\u306e\u8a18\u4e8b\u3067\u306fPython\u306eXPath\u306b\u3064\u3044\u3066\u89e3\u8aac\u3092\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>XPath\u3067\u306fWeb\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u3092\u3059\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002<\/p>\n\n\n\n<p>Python\u3067Web\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u3092\u3057\u305f\u3044\u3002<br>Python\u3067\u52b9\u7387\u7684\u306bHTML\u30c7\u30fc\u30bf\u3092\u89e3\u6790\u3057\u305f\u3044\u3002<\/p>\n\n\n\n<p>\u4eca\u56de\u306e\u8a18\u4e8b\u3067\u306f\u3053\u306e\u3088\u3046\u306b\u601d\u3063\u3066\u3044\u308b\u65b9\u306b\u5411\u3051\u3066\u3001<\/p>\n\n\n\n<p>\u3010\u57fa\u790e\u3011XPath\u3001\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u3068\u306f<br>\u3010\u57fa\u790e\u3011urllib\u3084lxml\u306a\u3069\u306e\u5fc5\u8981\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u3064\u3044\u3066<br>\u3010\u5b9f\u8df5\u3011\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u3092\u3059\u308b\u65b9\u6cd5<\/p>\n\n\n\n<p>\u306b\u3064\u3044\u3066\u89e3\u8aac\u3092\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>Python\u3067Web\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u3092\u3057\u3066\u307f\u307e\u3057\u3087\u3046\uff01<\/p>\n\n\n\n<p>\u672c\u8a18\u4e8b\u3092\u8aad\u3080\u524d\u306b\u3001Python\u304c\u3069\u3093\u306a\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u306a\u306e\u304b\u3092\u304a\u3055\u3089\u3044\u3057\u3066\u304a\u304d\u305f\u3044\u4eba\u306f\u6b21\u306e\u8a18\u4e8b\u3092\u53c2\u8003\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<p>\u2192&nbsp;<a href=\"https:\/\/www.sejuku.net\/blog\/7720\">Python\u3068\u306f\uff1f\u7279\u5fb4\u3084\u3067\u304d\u308b\u3053\u3068\u3001\u6d3b\u7528\u4f8b\u3092\u308f\u304b\u308a\u3084\u3059\u304f\u7c21\u5358\u306b\u89e3\u8aac<\/a><\/p>\n\n\n\n<p>\u306a\u304a\u3001\u305d\u306e\u4ed6\u306ePython\u306e\u8a18\u4e8b\u306b\u3064\u3044\u3066\u306f<a href=\"https:\/\/www.sejuku.net\/blog\/147190\" target=\"_blank\" rel=\"noopener\">\u3053\u3061\u3089<\/a>\u306b\u307e\u3068\u3081\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">XPath\u3068\u306f<\/h2>\n\n\n\n<p>XPath\uff08XML Path Language\uff09\u306f\u3001XML\u306e\u4e2d\u306e\u8981\u7d20\u3084\u5c5e\u6027\u306a\u3069\u3092\u6307\u5b9a\u3059\u308b\u305f\u3081\u306e\u8a00\u8a9e\u3067\u3059\u3002<\/p>\n\n\n\n<p>XML\u3067\u3057\u304b\u4f7f\u3048\u306a\u3044\u3088\u3046\u306b\u3082\u898b\u3048\u307e\u3059\u304c\u3001HTML\u3082XML\u306e\u4e00\u7a2e\u3068\u3057\u3066\u307f\u306a\u3059\u3053\u3068\u3067HTML\u306e\u30b3\u30fc\u30c9\u306b\u5bfe\u3057\u3066\u3082\u4f7f\u3046\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u306eXPath\u3092\u4f7f\u3046\u3053\u3068\u304c\u3067\u304d\u308c\u3070HTML\u306e\u30b3\u30fc\u30c9\u306b\u3042\u308b\u7279\u5b9a\u306e\u8981\u7d20\u3084\u5c5e\u6027\u306e\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002<\/p>\n\n\n\n<p>HTML\u306b\u3064\u3044\u3066\u5206\u304b\u3089\u306a\u3044\u65b9\u306f\u3001\u305c\u3072\u3053\u3061\u3089\u306e\u8a18\u4e8b\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n            <a href=\"https:\/\/www.sejuku.net\/blog\/6026\" class=\"blog-card-anchor\">\n                <div class=\"blog-card\">\n                <div class=\"blog-card-content\">\n                    <div class=\"blog-card-thumbnail\">\n                    <img decoding=\"async\" class=\"blog-card-thumbnail-img\" src=\"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2021\/02\/howto-02-1-150x85.jpg\">\n                    <\/div>\n                    <div class=\"blog-card-title-wrap\">\n                    <div class=\"blog-card-title\">HTML\u3068\u306f\uff1f\u3067\u304d\u308b\u3053\u3068\u3084\u30bf\u30b0\u306e\u7a2e\u985e\u3001\u52c9\u5f37\u65b9\u6cd5\u3082\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac<\/div>\n                    <div class=\"blog-card-update-date\">\u66f4\u65b0\u65e5\uff1a2025\u5e7412\u670826\u65e5<\/div>\n                    <\/div>\n                <\/div>\n                <\/div>\n            <\/a>\n            \n\n\n\n<h2 class=\"wp-block-heading\">\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u3068\u306f<\/h2>\n\n\n\n<p>\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u3068\u306f\u3001\u7279\u5b9a\u306eWeb\u30b5\u30a4\u30c8\u304b\u3089\u5fc5\u8981\u306a\u60c5\u5831\u3092\u62bd\u51fa\u3059\u308b\u3053\u3068\u3092\u8a00\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>Web\u30b5\u30a4\u30c8\u304b\u3089\u5fc5\u8981\u306a\u60c5\u5831\u3060\u3051\u3092\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u3057\u3066\u65b0\u3057\u304f\u30b9\u30de\u30fc\u30c8\u30d5\u30a9\u30f3\u5411\u3051\u306eWeb\u30b5\u30a4\u30c8\u3092\u4f5c\u3063\u305f\u308a\u3001\u4f1a\u793e\u306b\u95a2\u4fc2\u3059\u308b\u5185\u5bb9\u3060\u3051\u3092\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u3057\u3066\u30c7\u30fc\u30bf\u306e\u89e3\u6790\u306b\u5f79\u7acb\u3066\u305f\u308a\u3059\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u8a73\u3057\u304f\u306f\u3053\u3061\u3089\u306e\u8a18\u4e8b\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n            <a href=\"https:\/\/www.sejuku.net\/blog\/51241\" class=\"blog-card-anchor\">\n                <div class=\"blog-card\">\n                <div class=\"blog-card-content\">\n                    <div class=\"blog-card-thumbnail\">\n                    <img decoding=\"async\" class=\"blog-card-thumbnail-img\" src=\"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2019\/07\/python-web-sc-150x85.jpg\">\n                    <\/div>\n                    <div class=\"blog-card-title-wrap\">\n                    <div class=\"blog-card-title\">\u3010\u521d\u5fc3\u8005\u5411\u3051\u3011Python\u3067Web\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u3092\u3057\u3066\u307f\u3088\u3046\uff01\u624b\u9806\u307e\u3068\u3081<\/div>\n                    <div class=\"blog-card-update-date\">\u66f4\u65b0\u65e5\uff1a2025\u5e744\u670823\u65e5<\/div>\n                    <\/div>\n                <\/div>\n                <\/div>\n            <\/a>\n            \n\n\n\n<h2 class=\"wp-block-heading\">\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u306b\u5fc5\u8981\u306a\u30d1\u30c3\u30b1\u30fc\u30b8<\/h2>\n\n\n\n<p>Python\u3067\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u3092\u884c\u3046\u305f\u3081\u306b\u306f\u3044\u304f\u3064\u304b\u306e\u65b9\u6cd5\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u4e2d\u3067\u3082\u4eca\u56de\u306eXPath\u3092\u4f7f\u3063\u3066\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u3092\u3059\u308b\u305f\u3081\u306b\u306f\u3001urllib\u3068lxml\u3092\u4f7f\u3046\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>urllib\u3067\u306f\u3001\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u4e0a\u304b\u3089HTML\u30b3\u30fc\u30c9\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>lxml\u3067\u306f\u3001\u53d6\u5f97\u3057\u305fHTML\u30b3\u30fc\u30c9\u3092\u89e3\u6790\u3057\u3066\u5fc5\u8981\u306a\u60c5\u5831\u3060\u3051\u3092\u53d6\u308a\u51fa\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u305d\u308c\u3067\u306f\u305d\u308c\u305e\u308c\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u3064\u3044\u3066\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">urllib\u3068\u306f<\/h3>\n\n\n\n<p>urllib\u306fPython\u304b\u3089URL\u306b\u30a2\u30af\u30bb\u30b9\u3057\u305f\u308a\u3001\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u4e0a\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u53d6\u5f97\u3057\u305f\u308a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u30d1\u30c3\u30b1\u30fc\u30b8\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u7279\u306burllib.request\u3092\u4f7f\u3063\u3066\u3001\u7279\u5b9a\u306e\u30da\u30fc\u30b8\u306eHTML\u30b3\u30fc\u30c9\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u8a73\u3057\u304f\u306f\u3053\u3061\u3089\u306e\u8a18\u4e8b\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n            <a href=\"https:\/\/www.sejuku.net\/blog\/67698\" class=\"blog-card-anchor\">\n                <div class=\"blog-card\">\n                <div class=\"blog-card-content\">\n                    <div class=\"blog-card-thumbnail\">\n                    <img decoding=\"async\" class=\"blog-card-thumbnail-img\" src=\"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2018\/08\/image-23-150x86.jpg\">\n                    <\/div>\n                    <div class=\"blog-card-title-wrap\">\n                    <div class=\"blog-card-title\">\u3010Python\u5165\u9580\u3011urllib\u3092\u4f7f\u3063\u3066\u30d5\u30a1\u30a4\u30eb\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3088\u3046<\/div>\n                    <div class=\"blog-card-update-date\">\u66f4\u65b0\u65e5\uff1a2024\u5e745\u67086\u65e5<\/div>\n                    <\/div>\n                <\/div>\n                <\/div>\n            <\/a>\n            \n\n\n\n<h3 class=\"wp-block-heading\">lxml\u3068\u306f<\/h3>\n\n\n\n<p>lxml\u306fXML\u306e\u69cb\u6587\u3092\u89e3\u6790\u3059\u308b\u305f\u3081\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u4eca\u56de\u306f\u7279\u306b\u3001lxml.html\u3092\u4f7f\u3063\u3066\u3001HTML\u30b3\u30fc\u30c9\u3092\u89e3\u6790\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>lxml\u306f\u6a19\u6e96\u3067\u30d7\u30ea\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u306a\u3044\u306e\u3067\u3001pip\u3092\u4f7f\u3063\u3066\u81ea\u5206\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">pip install lxml<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u3092\u3059\u308b\u65b9\u6cd5<\/h2>\n\n\n\n<p>\u305d\u308c\u3067\u306f\u65e9\u901f\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u3092\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<p>\u3053\u3053\u304b\u3089\u306f\u9806\u3092\u8ffd\u3063\u3066\u89e3\u8aac\u3057\u3066\u3044\u304d\u307e\u3059\uff01<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">urllib\u3068lxml\u3092import\u3059\u308b<\/h3>\n\n\n\n<p>\u307e\u305a\u306f\u5fc5\u8981\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u4f7f\u3048\u308b\u3088\u3046\u306bimport\u3092\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">from urllib import request\nfrom lxml import html<\/pre>\n\n\n\n<p>import\u306e\u65b9\u6cd5\u306b\u3064\u3044\u3066\u306f\u3053\u3061\u3089\u306e\u8a18\u4e8b\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n            <a href=\"https:\/\/www.sejuku.net\/blog\/25587\" class=\"blog-card-anchor\">\n                <div class=\"blog-card\">\n                <div class=\"blog-card-content\">\n                    <div class=\"blog-card-thumbnail\">\n                    <img decoding=\"async\" class=\"blog-card-thumbnail-img\" src=\"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2017\/06\/image-126-150x84.jpg\">\n                    <\/div>\n                    <div class=\"blog-card-title-wrap\">\n                    <div class=\"blog-card-title\">\u306f\u3058\u3081\u3066\u306ePython\uff01\u30d1\u30c3\u30b1\u30fc\u30b8\u3092import\u3059\u308b\u65b9\u6cd5\u3092\u3084\u3055\u3057\u304f\u89e3\u8aac\uff01<\/div>\n                    <div class=\"blog-card-update-date\">\u66f4\u65b0\u65e5\uff1a2024\u5e745\u67086\u65e5<\/div>\n                    <\/div>\n                <\/div>\n                <\/div>\n            <\/a>\n            \n\n\n\n<h3 class=\"wp-block-heading\">HTML\u3092\u53d6\u5f97\u3059\u308b<\/h3>\n\n\n\n<p>\u6b21\u306f\u76ee\u7684\u306e\u30b5\u30a4\u30c8\u306eHTML\u3092\u53d6\u5f97\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<p>\u4eca\u56de\u306f <a href=\"http:\/\/www.example.com\" target=\"_blank\" rel=\"noopener noreferrer\">example.com<\/a> \u3092\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u3061\u3089\u306e\u30b3\u30fc\u30c9\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">from urllib import request\nfrom lxml import html\n\nURL = \"http:\/\/www.example.com\"\ndata = request.urlopen(URL)\nhtml = data.read()\nprint(html)<\/pre>\n\n\n\n<p>\u5b9f\u884c\u7d50\u679c<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">b'&lt;!doctype html&gt;n&lt;html&gt;n&lt;head&gt;n    &lt;title&gt;Example Domain&lt;\/title&gt;nn    &lt;meta charset=\"utf-8\" \/&gt;n    &lt;meta http-equiv=\"Content-type\" content=\"text\/html; charset=utf-8\" \/&gt;n    &lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" \/&gt;n    &lt;style type=\"text\/css\"&gt;n    body {n        background-color: #f0f0f2;n        margin: 0;n        padding: 0;n        font-family: \"Open Sans\", \"Helvetica Neue\", Helvetica, Arial, sans-serif;n        n    }n    div {n        width: 600px;n        margin: 5em auto;n        padding: 50px;n        background-color: #fff;n        border-radius: 1em;n    }n    a:link, a:visited {n        color: #38488f;n        text-decoration: none;n    }n    @media (max-width: 700px) {n        body {n            background-color: #fff;n        }n        div {n            width: auto;n            margin: 0 auto;n            border-radius: 0;n            padding: 1em;n        }n    }n    &lt;\/style&gt;    n&lt;\/head&gt;nn&lt;body&gt;n&lt;div&gt;n    &lt;h1&gt;Example Domain&lt;\/h1&gt;n    &lt;p&gt;This domain is established to be used for illustrative examples in documents. You may use thisn    domain in examples without prior coordination or asking for permission.&lt;\/p&gt;n    &lt;p&gt;&lt;a href=\"http:\/\/www.iana.org\/domains\/example\"&gt;More information...&lt;\/a&gt;&lt;\/p&gt;n&lt;\/div&gt;n&lt;\/body&gt;n&lt;\/html&gt;n'<\/pre>\n\n\n\n<p>\u3053\u308c\u306f\u5148\u7a0b\u7d39\u4ecb\u3057\u305furllib\u306e\u89e3\u8aac\u8a18\u4e8b\u3068\u307b\u307c\u540c\u3058\u30b3\u30fc\u30c9\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>URL\u3092\u6307\u5b9a\u3057\u3066\u3001\u305d\u3053\u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u305fHTML\u3092\u8868\u793a\u3055\u305b\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u4e0a\u304b\u3089HTML\u3092\u53d6\u5f97\u3059\u308b\u3053\u3068\u306f\u51fa\u6765\u305f\u306e\u3067\u3001\u6b21\u306f\u3053\u306eHTML\u30b3\u30fc\u30c9\u304b\u3089\u5fc5\u8981\u306a\u90e8\u5206\u3092\u62bd\u51fa\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u4eca\u56de\u306fh1\u3092\u62bd\u51fa\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u4f7f\u3044\u305f\u3044\u8981\u7d20\u3092\u6307\u5b9a\u3059\u308b<\/h3>\n\n\n\n<p>\u5148\u7a0b\u307e\u3067\u306f\u3059\u3079\u3066urllib\u3092\u4f7f\u3063\u305f\u64cd\u4f5c\u3067\u3057\u305f\u304c\u3001\u3053\u308c\u304b\u3089\u306flxml\u3092\u4f7f\u3063\u3066HTML\u306e\u5fc5\u8981\u306a\u90e8\u5206\u306e\u307f\u3092\u62bd\u51fa\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u3061\u3089\u306e\u30b3\u30fc\u30c9\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">from urllib import request\nfrom lxml import html\n\nURL = \"http:\/\/www.example.com\"\ndata = request.urlopen(URL)\nraw_html = data.read()\nhtml = html.fromstring(str(raw_html))\ntitle = html.xpath(\"\/html\/body\/h1\")\nprint(title)<\/pre>\n\n\n\n<p>\u5b9f\u884c\u7d50\u679c<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Example Domain<\/pre>\n\n\n\n<p>\u3053\u306e\u30b3\u30fc\u30c9\u3067\u306f\u3001\u53d6\u5f97\u3057\u305fHTML\u306e\u30b3\u30fc\u30c9\u304b\u3089\u3001lxml.html\u306eXPath\u3092\u4f7f\u3063\u3066h1\u3092\u53d6\u5f97\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u7121\u4e8b\u306b\u53d6\u5f97\u51fa\u6765\u3066\u3044\u307e\u3059\u306d\u3002<\/p>\n\n\n\n<p>\u3084\u3084\u3053\u3057\u3044\u30b3\u30fc\u30c9\u306b\u898b\u3048\u307e\u3059\u304c\u3001\u57fa\u672c\u7684\u306b\u306f\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u305f\u30b3\u30fc\u30c9\u306bXPath\u3067\u6307\u5b9a\u3057\u305f\u5f62\u5f0f\u306e\u90e8\u5206\u3092title\u306b\u5165\u308c\u3066\u3044\u308b\u3060\u3051\u306e\u4f5c\u696d\u3067\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u307e\u3068\u3081<\/h2>\n\n\n\n<p>\u3053\u306e\u8a18\u4e8b\u3067\u306fPython\u3067XPath\u3092\u4f7f\u3046\u65b9\u6cd5\u306b\u3064\u3044\u3066\u89e3\u8aac\u3092\u3057\u3066\u304d\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>XPath\u3084\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u3068\u306f\u4f55\u304b\u306b\u3064\u3044\u3066\u5206\u304b\u3063\u3066\u3044\u305f\u3060\u3051\u305f\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n\n\n\n<p>Python\u306f\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u3067\u3082\u3088\u304f\u4f7f\u308f\u308c\u3066\u3044\u3066\u3001\u7d39\u4ecb\u3057\u305f\u4ed6\u306b\u3082\u69d8\u3005\u306a\u624b\u6cd5\u304c\u4f7f\u308f\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u305c\u3072\u8abf\u3079\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u306e\u8a18\u4e8b\u3067\u306fPython\u306eXPath\u306b\u3064\u3044\u3066\u89e3\u8aac\u3092\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002 XPath\u3067\u306fWeb\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u3092\u3059\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002 Python\u3067Web\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u3092\u3057\u305f\u3044\u3002Python\u3067\u52b9\u7387\u7684\u306bHTML\u30c7\u30fc\u30bf\u3092\u89e3\u6790\u3057\u305f\u3044 [&hellip;]<\/p>\n","protected":false},"author":16433,"featured_media":69601,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"swell_btn_cv_data":"","footnotes":""},"categories":[2350],"tags":[49,1863],"class_list":["post-69365","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python-study","tag-python","tag-xpath"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>\u3010Python\u5165\u9580\u3011XPath\u3067\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u3059\u308b\u624b\u9806\u3092\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\uff01 | \u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0<\/title>\n<meta name=\"description\" content=\"\u3053\u306e\u8a18\u4e8b\u3067\u306f\u300c \u3010Python\u5165\u9580\u3011XPath\u3067\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u3059\u308b\u624b\u9806\u3092\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\uff01 \u300d\u306b\u3064\u3044\u3066\u3001\u8ab0\u3067\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u306b\u89e3\u8aac\u3057\u307e\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3092\u8aad\u3081\u3070\u3001\u3042\u306a\u305f\u306e\u60a9\u307f\u304c\u89e3\u6c7a\u3059\u308b\u3060\u3051\u3058\u3083\u306a\u304f\u3001\u65b0\u305f\u306a\u6c17\u4ed8\u304d\u3082\u767a\u898b\u3067\u304d\u308b\u3053\u3068\u3067\u3057\u3087\u3046\u3002\u304a\u60a9\u307f\u306e\u65b9\u306f\u305c\u3072\u3054\u4e00\u8aad\u304f\u3060\u3055\u3044\u3002\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.sejuku.net\/blog\/69365\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u3010Python\u5165\u9580\u3011XPath\u3067\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u3059\u308b\u624b\u9806\u3092\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\uff01 | \u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0\" \/>\n<meta property=\"og:description\" content=\"\u3053\u306e\u8a18\u4e8b\u3067\u306f\u300c \u3010Python\u5165\u9580\u3011XPath\u3067\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u3059\u308b\u624b\u9806\u3092\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\uff01 \u300d\u306b\u3064\u3044\u3066\u3001\u8ab0\u3067\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u306b\u89e3\u8aac\u3057\u307e\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3092\u8aad\u3081\u3070\u3001\u3042\u306a\u305f\u306e\u60a9\u307f\u304c\u89e3\u6c7a\u3059\u308b\u3060\u3051\u3058\u3083\u306a\u304f\u3001\u65b0\u305f\u306a\u6c17\u4ed8\u304d\u3082\u767a\u898b\u3067\u304d\u308b\u3053\u3068\u3067\u3057\u3087\u3046\u3002\u304a\u60a9\u307f\u306e\u65b9\u306f\u305c\u3072\u3054\u4e00\u8aad\u304f\u3060\u3055\u3044\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sejuku.net\/blog\/69365\" \/>\n<meta property=\"og:site_name\" content=\"\u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/sejuku2013\" \/>\n<meta property=\"article:published_time\" content=\"2018-08-27T05:06:07+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-05-06T02:51:02+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2018\/08\/image-26.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"700\" \/>\n\t<meta property=\"og:image:height\" content=\"400\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"\u4f8d\u30c6\u30c3\u30af\u7de8\u96c6\u90e8\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@samuraijuku\" \/>\n<meta name=\"twitter:site\" content=\"@samuraijuku\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/69365#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/69365\"},\"author\":{\"name\":\"\u4f8d\u30c6\u30c3\u30af\u7de8\u96c6\u90e8\",\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/#\\\/schema\\\/person\\\/d20c57b59dba15001519a8a671183095\"},\"headline\":\"\u3010Python\u5165\u9580\u3011XPath\u3067\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u3059\u308b\u624b\u9806\u3092\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\uff01\",\"datePublished\":\"2018-08-27T05:06:07+00:00\",\"dateModified\":\"2024-05-06T02:51:02+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/69365\"},\"wordCount\":312,\"publisher\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/69365#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/08\\\/image-26.jpg\",\"keywords\":[\"python\",\"xpath\"],\"articleSection\":[\"Python\u5b66\u7fd2\"],\"inLanguage\":\"ja\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/69365\",\"url\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/69365\",\"name\":\"\u3010Python\u5165\u9580\u3011XPath\u3067\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u3059\u308b\u624b\u9806\u3092\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\uff01 | \u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/69365#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/69365#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/08\\\/image-26.jpg\",\"datePublished\":\"2018-08-27T05:06:07+00:00\",\"dateModified\":\"2024-05-06T02:51:02+00:00\",\"description\":\"\u3053\u306e\u8a18\u4e8b\u3067\u306f\u300c \u3010Python\u5165\u9580\u3011XPath\u3067\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u3059\u308b\u624b\u9806\u3092\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\uff01 \u300d\u306b\u3064\u3044\u3066\u3001\u8ab0\u3067\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u306b\u89e3\u8aac\u3057\u307e\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3092\u8aad\u3081\u3070\u3001\u3042\u306a\u305f\u306e\u60a9\u307f\u304c\u89e3\u6c7a\u3059\u308b\u3060\u3051\u3058\u3083\u306a\u304f\u3001\u65b0\u305f\u306a\u6c17\u4ed8\u304d\u3082\u767a\u898b\u3067\u304d\u308b\u3053\u3068\u3067\u3057\u3087\u3046\u3002\u304a\u60a9\u307f\u306e\u65b9\u306f\u305c\u3072\u3054\u4e00\u8aad\u304f\u3060\u3055\u3044\u3002\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/69365#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/69365\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/69365#primaryimage\",\"url\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/08\\\/image-26.jpg\",\"contentUrl\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/08\\\/image-26.jpg\",\"width\":700,\"height\":400},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/69365#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u3010Python\u5165\u9580\u3011XPath\u3067\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u3059\u308b\u624b\u9806\u3092\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\uff01\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/\",\"name\":\"\u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0\",\"description\":\"\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u5b66\u7fd2\u306e\u3059\u3079\u3066\u304c\u30b3\u30b3\u306b\u3002\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ja\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/#organization\",\"name\":\"\u682a\u5f0f\u4f1a\u793eSAMURAI\",\"url\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/logo.png\",\"contentUrl\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/logo.png\",\"width\":600,\"height\":600,\"caption\":\"\u682a\u5f0f\u4f1a\u793eSAMURAI\"},\"image\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/sejuku2013\",\"https:\\\/\\\/x.com\\\/samuraijuku\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCCFOQO5aDK0xXam4cUQXT8g\\\/featured\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/#\\\/schema\\\/person\\\/d20c57b59dba15001519a8a671183095\",\"name\":\"\u4f8d\u30c6\u30c3\u30af\u7de8\u96c6\u90e8\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d91ed20aaa7f873a0f4f35586561303460c1e3864746dddb6ebe0fb093c1952d?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d91ed20aaa7f873a0f4f35586561303460c1e3864746dddb6ebe0fb093c1952d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d91ed20aaa7f873a0f4f35586561303460c1e3864746dddb6ebe0fb093c1952d?s=96&d=mm&r=g\",\"caption\":\"\u4f8d\u30c6\u30c3\u30af\u7de8\u96c6\u90e8\"},\"description\":\"\u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u587e\u306f\u300c\u4eba\u751f\u3092\u5909\u3048\u308b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u5b66\u7fd2\u300d\u3092\u30b3\u30f3\u30bb\u30f3\u30d7\u30c8\u306b\u3001\u904e\u53bb\u591a\u304f\u306e\u30d5\u30ea\u30fc\u30e9\u30f3\u30b9\u30a8\u30f3\u30b8\u30cb\u30a2\u3092\u8f29\u51fa\u3057\u305f\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30b9\u30af\u30fc\u30eb\u3067\u3059\u3002\u4f8d\u30c6\u30c3\u30af\u7de8\u96c6\u90e8\u3067\u306f\u6280\u8853\u7cfb\u30b3\u30f3\u30c6\u30f3\u30c4\u3092\u4e2d\u5fc3\u306b\u6709\u7528\u306a\u60c5\u5831\u3092\u767a\u4fe1\u3057\u3066\u3044\u304d\u307e\u3059\u3002\",\"url\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/author\\\/samurai-tech\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u3010Python\u5165\u9580\u3011XPath\u3067\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u3059\u308b\u624b\u9806\u3092\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\uff01 | \u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0","description":"\u3053\u306e\u8a18\u4e8b\u3067\u306f\u300c \u3010Python\u5165\u9580\u3011XPath\u3067\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u3059\u308b\u624b\u9806\u3092\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\uff01 \u300d\u306b\u3064\u3044\u3066\u3001\u8ab0\u3067\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u306b\u89e3\u8aac\u3057\u307e\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3092\u8aad\u3081\u3070\u3001\u3042\u306a\u305f\u306e\u60a9\u307f\u304c\u89e3\u6c7a\u3059\u308b\u3060\u3051\u3058\u3083\u306a\u304f\u3001\u65b0\u305f\u306a\u6c17\u4ed8\u304d\u3082\u767a\u898b\u3067\u304d\u308b\u3053\u3068\u3067\u3057\u3087\u3046\u3002\u304a\u60a9\u307f\u306e\u65b9\u306f\u305c\u3072\u3054\u4e00\u8aad\u304f\u3060\u3055\u3044\u3002","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.sejuku.net\/blog\/69365","og_locale":"ja_JP","og_type":"article","og_title":"\u3010Python\u5165\u9580\u3011XPath\u3067\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u3059\u308b\u624b\u9806\u3092\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\uff01 | \u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0","og_description":"\u3053\u306e\u8a18\u4e8b\u3067\u306f\u300c \u3010Python\u5165\u9580\u3011XPath\u3067\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u3059\u308b\u624b\u9806\u3092\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\uff01 \u300d\u306b\u3064\u3044\u3066\u3001\u8ab0\u3067\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u306b\u89e3\u8aac\u3057\u307e\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3092\u8aad\u3081\u3070\u3001\u3042\u306a\u305f\u306e\u60a9\u307f\u304c\u89e3\u6c7a\u3059\u308b\u3060\u3051\u3058\u3083\u306a\u304f\u3001\u65b0\u305f\u306a\u6c17\u4ed8\u304d\u3082\u767a\u898b\u3067\u304d\u308b\u3053\u3068\u3067\u3057\u3087\u3046\u3002\u304a\u60a9\u307f\u306e\u65b9\u306f\u305c\u3072\u3054\u4e00\u8aad\u304f\u3060\u3055\u3044\u3002","og_url":"https:\/\/www.sejuku.net\/blog\/69365","og_site_name":"\u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0","article_publisher":"https:\/\/www.facebook.com\/sejuku2013","article_published_time":"2018-08-27T05:06:07+00:00","article_modified_time":"2024-05-06T02:51:02+00:00","og_image":[{"width":700,"height":400,"url":"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2018\/08\/image-26.jpg","type":"image\/jpeg"}],"author":"\u4f8d\u30c6\u30c3\u30af\u7de8\u96c6\u90e8","twitter_card":"summary_large_image","twitter_creator":"@samuraijuku","twitter_site":"@samuraijuku","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.sejuku.net\/blog\/69365#article","isPartOf":{"@id":"https:\/\/www.sejuku.net\/blog\/69365"},"author":{"name":"\u4f8d\u30c6\u30c3\u30af\u7de8\u96c6\u90e8","@id":"https:\/\/www.sejuku.net\/blog\/#\/schema\/person\/d20c57b59dba15001519a8a671183095"},"headline":"\u3010Python\u5165\u9580\u3011XPath\u3067\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u3059\u308b\u624b\u9806\u3092\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\uff01","datePublished":"2018-08-27T05:06:07+00:00","dateModified":"2024-05-06T02:51:02+00:00","mainEntityOfPage":{"@id":"https:\/\/www.sejuku.net\/blog\/69365"},"wordCount":312,"publisher":{"@id":"https:\/\/www.sejuku.net\/blog\/#organization"},"image":{"@id":"https:\/\/www.sejuku.net\/blog\/69365#primaryimage"},"thumbnailUrl":"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2018\/08\/image-26.jpg","keywords":["python","xpath"],"articleSection":["Python\u5b66\u7fd2"],"inLanguage":"ja"},{"@type":"WebPage","@id":"https:\/\/www.sejuku.net\/blog\/69365","url":"https:\/\/www.sejuku.net\/blog\/69365","name":"\u3010Python\u5165\u9580\u3011XPath\u3067\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u3059\u308b\u624b\u9806\u3092\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\uff01 | \u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0","isPartOf":{"@id":"https:\/\/www.sejuku.net\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.sejuku.net\/blog\/69365#primaryimage"},"image":{"@id":"https:\/\/www.sejuku.net\/blog\/69365#primaryimage"},"thumbnailUrl":"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2018\/08\/image-26.jpg","datePublished":"2018-08-27T05:06:07+00:00","dateModified":"2024-05-06T02:51:02+00:00","description":"\u3053\u306e\u8a18\u4e8b\u3067\u306f\u300c \u3010Python\u5165\u9580\u3011XPath\u3067\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u3059\u308b\u624b\u9806\u3092\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\uff01 \u300d\u306b\u3064\u3044\u3066\u3001\u8ab0\u3067\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u306b\u89e3\u8aac\u3057\u307e\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3092\u8aad\u3081\u3070\u3001\u3042\u306a\u305f\u306e\u60a9\u307f\u304c\u89e3\u6c7a\u3059\u308b\u3060\u3051\u3058\u3083\u306a\u304f\u3001\u65b0\u305f\u306a\u6c17\u4ed8\u304d\u3082\u767a\u898b\u3067\u304d\u308b\u3053\u3068\u3067\u3057\u3087\u3046\u3002\u304a\u60a9\u307f\u306e\u65b9\u306f\u305c\u3072\u3054\u4e00\u8aad\u304f\u3060\u3055\u3044\u3002","breadcrumb":{"@id":"https:\/\/www.sejuku.net\/blog\/69365#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sejuku.net\/blog\/69365"]}]},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.sejuku.net\/blog\/69365#primaryimage","url":"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2018\/08\/image-26.jpg","contentUrl":"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2018\/08\/image-26.jpg","width":700,"height":400},{"@type":"BreadcrumbList","@id":"https:\/\/www.sejuku.net\/blog\/69365#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sejuku.net\/blog\/"},{"@type":"ListItem","position":2,"name":"\u3010Python\u5165\u9580\u3011XPath\u3067\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u3059\u308b\u624b\u9806\u3092\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\uff01"}]},{"@type":"WebSite","@id":"https:\/\/www.sejuku.net\/blog\/#website","url":"https:\/\/www.sejuku.net\/blog\/","name":"\u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0","description":"\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u5b66\u7fd2\u306e\u3059\u3079\u3066\u304c\u30b3\u30b3\u306b\u3002","publisher":{"@id":"https:\/\/www.sejuku.net\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.sejuku.net\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ja"},{"@type":"Organization","@id":"https:\/\/www.sejuku.net\/blog\/#organization","name":"\u682a\u5f0f\u4f1a\u793eSAMURAI","url":"https:\/\/www.sejuku.net\/blog\/","logo":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.sejuku.net\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2023\/07\/logo.png","contentUrl":"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2023\/07\/logo.png","width":600,"height":600,"caption":"\u682a\u5f0f\u4f1a\u793eSAMURAI"},"image":{"@id":"https:\/\/www.sejuku.net\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/sejuku2013","https:\/\/x.com\/samuraijuku","https:\/\/www.youtube.com\/channel\/UCCFOQO5aDK0xXam4cUQXT8g\/featured"]},{"@type":"Person","@id":"https:\/\/www.sejuku.net\/blog\/#\/schema\/person\/d20c57b59dba15001519a8a671183095","name":"\u4f8d\u30c6\u30c3\u30af\u7de8\u96c6\u90e8","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/secure.gravatar.com\/avatar\/d91ed20aaa7f873a0f4f35586561303460c1e3864746dddb6ebe0fb093c1952d?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/d91ed20aaa7f873a0f4f35586561303460c1e3864746dddb6ebe0fb093c1952d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d91ed20aaa7f873a0f4f35586561303460c1e3864746dddb6ebe0fb093c1952d?s=96&d=mm&r=g","caption":"\u4f8d\u30c6\u30c3\u30af\u7de8\u96c6\u90e8"},"description":"\u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u587e\u306f\u300c\u4eba\u751f\u3092\u5909\u3048\u308b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u5b66\u7fd2\u300d\u3092\u30b3\u30f3\u30bb\u30f3\u30d7\u30c8\u306b\u3001\u904e\u53bb\u591a\u304f\u306e\u30d5\u30ea\u30fc\u30e9\u30f3\u30b9\u30a8\u30f3\u30b8\u30cb\u30a2\u3092\u8f29\u51fa\u3057\u305f\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30b9\u30af\u30fc\u30eb\u3067\u3059\u3002\u4f8d\u30c6\u30c3\u30af\u7de8\u96c6\u90e8\u3067\u306f\u6280\u8853\u7cfb\u30b3\u30f3\u30c6\u30f3\u30c4\u3092\u4e2d\u5fc3\u306b\u6709\u7528\u306a\u60c5\u5831\u3092\u767a\u4fe1\u3057\u3066\u3044\u304d\u307e\u3059\u3002","url":"https:\/\/www.sejuku.net\/blog\/author\/samurai-tech"}]}},"_links":{"self":[{"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/posts\/69365","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/users\/16433"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/comments?post=69365"}],"version-history":[{"count":0,"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/posts\/69365\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/media\/69601"}],"wp:attachment":[{"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/media?parent=69365"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/categories?post=69365"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/tags?post=69365"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}