{"id":1112,"date":"2018-09-27T13:18:44","date_gmt":"2018-09-27T04:18:44","guid":{"rendered":"https:\/\/yuis-programming.com\/?p=1112"},"modified":"2021-11-07T10:49:42","modified_gmt":"2021-11-07T01:49:42","slug":"selenium-webdriver%e3%81%a7%e3%83%9a%e3%83%bc%e3%82%b8%e3%82%92pdf%e3%81%a8%e3%81%97%e3%81%a6%e4%bf%9d%e5%ad%98%e3%81%99%e3%82%8b%e3%81%8b%e3%83%aa%e3%82%bd%e3%83%bc%e3%82%b9%e3%82%92%e5%90%ab","status":"publish","type":"post","link":"https:\/\/yuis-programming.com\/?p=1112","title":{"rendered":"Selenium Webdriver\u3067\u30da\u30fc\u30b8\u3092PDF\u3068\u3057\u3066\u4fdd\u5b58\u3057\u305f\u304b\u3063\u305f"},"content":{"rendered":"<p>selenium webdriver\u3067\u30da\u30fc\u30b8\u3092PDF\u3068\u3057\u3066\u4fdd\u5b58\u3059\u308b\u304b\u3001\u30ea\u30bd\u30fc\u30b9\u3092\u542b\u3093\u3060HTML\u3092\u4fdd\u5b58\u3057\u305f\u304b\u3063\u305f\u306e\u3067\u8272\u3005\u8abf\u3079\u3066\u307f\u307e\u3057\u305f\u304c\u3001\u3069\u3046\u3082\u96e3\u3057\u305d\u3046\u3067\u3059\u3002<\/p>\n<p>\u307e\u305a\u3001selenium\u306e\u30d5\u30a9\u30fc\u30e9\u30e0\u306b\u8cea\u554f\u3057\u307e\u3057\u305f\u3002\u30da\u30fc\u30b8\u3092PDF\u30d5\u30a1\u30a4\u30eb\u3067\u4fdd\u5b58\u3057\u305f\u3044\u3093\u3060\u3051\u3069\u3067\u304d\u306a\u3044\uff1f\u3063\u3066\u3002<\/p>\n<p><a href=\"https:\/\/groups.google.com\/forum\/#!topic\/selenium-users\/Va8Czy2UHdI\">How to print current opened page as PDF file? &#8211; Google Groups<\/a><\/p>\n<p>\u307e\u3041\u4ed6\u306e\u30b5\u30a4\u30c8\u8abf\u3079\u3066\u307f\u3066\u3066\u3001\u3044\u3084\u305d\u308c\u306fselenium\u3067\u304d\u306a\u3044\u304b\u3089\u3002\u4f55\u5ea6\u3082\u8a00\u3063\u3066\u308b\u3088\u306d\uff1f\u307f\u305f\u3044\u306b\u6012\u3089\u308c\u308b\u304b\u306a\u3041\u3068\u601d\u3063\u3066\u305f\u3051\u3069\u305d\u3082\u305d\u3082\u56de\u7b54\u3059\u3089\u6765\u306a\u304b\u3063\u305f\u3068\u3044\u3046\u3002<\/p>\n<p>\u307e\u3041\u3001\u30d5\u30a9\u30fc\u30e9\u30e0\u306e\u52d5\u304d\u307f\u3066\u3082\u30011\u65e5\u306b\u4e00\u5ea6\u6295\u7a3f\u3055\u308c\u308b\u304b\u3069\u3046\u304b\u3063\u3066\u3044\u3046\u30ec\u30d9\u30eb\u306e\u898f\u6a21\u307f\u305f\u3044\u3060\u304b\u3089\u2026\u3061\u3087\u3063\u3068\u304d\u3064\u3044\u3002<\/p>\n<blockquote><p>Do you want to save HTML pages without any CSS, JS, images etc. ? If Yes<br \/>\nthe WebDriver object offers a method getPageSource() which saves the raw<br \/>\nHTML page.<\/p><\/blockquote>\n<p><a href=\"https:\/\/grokbase.com\/t\/gg\/selenium-users\/1478ay1f2p\/how-to-save-a-html-file\">[selenium-users] How to save a html file &#8211; Grokbase<\/a><\/p>\n<p>HTML\u306e\u4fdd\u5b58\u3060\u3051\u3060\u3063\u305f\u3089page_source\u30e1\u30bd\u30c3\u30c9\u3067\u3067\u304d\u308b\u3088\u3001\u3068\u3044\u3063\u3066\u3044\u307e\u3059\u306d\u3002\u305d\u308c\u306f\u77e5\u3063\u3066\u307e\u3059\u3002<\/p>\n<p>\u3061\u3087\u3063\u3068\u8a71\u98db\u3073\u307e\u3059\u304c\u3001\u5b9f\u306f\u3053\u306eHTML\u306e\u4fdd\u5b58\u3082\u5b8c\u5168\u3067\u306f\u306a\u3044\u3093\u3067\u3059\u3088\u306d\u3002\u3055\u3063\u304d\u8a66\u3057\u307e\u3057\u305f\u3051\u3069\u3001\u4fdd\u5b58\u3057\u305fHTML\u3092PDF\u306b\u5909\u63db\u3057\u3088\u3046\u3068\u3057\u305f\u3093\u3067\u3059\u3088\u3002<br \/>\n\u305d\u3057\u305f\u3089\u30a8\u30e9\u30fc\u51fa\u3066\u3002\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u554f\u984c\u304b\u306a\u3068\u601d\u3063\u305f\u3051\u3069\u3069\u3046\u3082\u9055\u3046\u30022\u3064\u4f7f\u3063\u3066\u30a8\u30e9\u30fc\u3063\u3066\u306e\u306f\u306a\u3044\u3060\u308d\u3046\u3002\u3063\u3066\u3053\u3068\u3067\u30a8\u30e9\u30fc\u51fa\u305f\u90e8\u5206\u306e\u884c\u3068\u3001\u5b9f\u969b\u306b\u30d6\u30e9\u30a6\u30b8\u30f3\u30b0\u3057\u305f\u5834\u5408\u306b\u8868\u793a\u3055\u308c\u308b\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u898b\u6bd4\u3079\u3066\u307f\u308b\u3068\u3001\u3084\u306f\u308a\u9055\u3046\u3093\u3067\u3059\u3088\u306d\u3002\u3067\u305d\u308c\u304c\u539f\u56e0\u3060\u308d\u3046\u3001\u3068\u3002<br \/>\n\u3082\u3046\u4e07\u7b56\u5c3d\u304d\u307e\u3059\u3088\u3002<\/p>\n<blockquote><p>Use getHtmlSource and parse the resulting HTML for references to external files, which you can then download and store outside of Selenium.<\/p><\/blockquote>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/3049632\/saving-full-page-content-using-selenium\">Saving full page content using Selenium &#8211; Stack Overflow<\/a><\/p>\n<p>getHtmlSource\u3063\u3066\u3044\u3046\u30c4\u30fc\u30eb\u304c\u3042\u308b\u307f\u305f\u3044\u3067\u3059\u3002\u304c\u3001\u305d\u308c\u306e\u60c5\u5831\u304c\u5c11\u306a\u3059\u304e\u3066\u8ae6\u3081\u307e\u3057\u305f\u3002<\/p>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/10926216\/selenium-2-how-to-save-a-html-page-including-all-referenced-resources-css-js\">webdriver &#8211; Selenium 2: How to save a HTML page including all referenced resources (css, js, images&#8230;)? &#8211; Stack Overflow<\/a><\/p>\n<p>\u3053\u308c\u306f\u60c5\u5831\u304c\u53e4\u3059\u304e\u308b\u306e\u3068Java\u306a\u306e\u3067\u898b\u3066\u3082\u5206\u304b\u3089\u306a\u3044\u3002<\/p>\n<blockquote><p>Yeah, don&#8217;t use Selenium for this.<\/p>\n<p>http:\/\/www.gnu.org\/software\/wget\/<\/p><\/blockquote>\n<p><a href=\"https:\/\/groups.google.com\/forum\/#!topic\/selenium-users\/fZ84y1Qsy1g\">How to save a HTML page including all its resources (css, js, images\u2026)? &#8211; Google Groups<\/a><\/p>\n<p>selenium\u3067\u3084\u3089\u306a\u3044\u3067wget\u3067\u3084\u308d\u3046\u306d\u3063\u3066\u8a00\u3063\u3066\u307e\u3059\u304c\u3001\u3053\u3053\u306e\u8cea\u554f\u8005\u3055\u3093\u3082\u8a00\u3063\u3066\u307e\u3059\u304c\u3001JavaScript\u4f7f\u3044\u305f\u3044\u3093\u3060\u3088\uff01\u3063\u3066\u3053\u3068\u3067\u3059\u306d\u3002\u3060\u304b\u3089wget\u3058\u3083\u3060\u3081\u306a\u3093\u3060\u3063\u3066\u3002<br \/>\n\u4e00\u6642\u7684\u306b\u30ed\u30b0\u30a4\u30f3\u51fa\u6765\u3066\u3082\u3001\u305d\u306e\u3042\u3068\u66f4\u306b\u30ad\u30fc\u30ef\u30fc\u30c9\u5165\u529b\u3068\u304b\u3042\u3063\u305f\u3089wget\u3058\u3083\u3067\u304d\u306a\u3044\u3060\u308d\u3046\u3057\u3001\u51fa\u6765\u3066\u3082wget\u306e\u307b\u3046\u304c\u5927\u5909\u306b\u306a\u308a\u305d\u3046\u3002\u3063\u3066\u304b\u666e\u901a\u306bwget\u3058\u3083JavaScript\u4f7f\u3048\u307e\u305b\u3093\u3088\u306d\uff1f\uff1f<\/p>\n<p>\u6700\u5f8c\u306b\u3053\u3053\u7d39\u4ecb\u3002<br \/>\n\u4e00\u756a\u671f\u5f85\u3057\u3066\u305f\u3093\u3060\u3051\u3069\u7121\u7406\u3060\u3063\u305f\u3002<\/p>\n<p><a href=\"http:\/\/takuya-1st.hatenablog.jp\/entry\/2017\/06\/21\/140000\">Selenium\u3067\u5370\u5237(print preview)\u3092\u7d4c\u3066PDF\u3092\u4fdd\u5b58\u3059\u308b\u65b9\u6cd5 &#8211; \u305d\u308c\u30de\u30b0\u3067\uff01<\/a><\/p>\n<blockquote><p>window.print \u3067\u8868\u793a\u3055\u308c\u305f\u3001\u5370\u5237\u30c0\u30a4\u30a2\u30ed\u30b0\u3067\u3001\u30dc\u30bf\u30f3\u3092\u62bc\u3059\u3053\u3068\u306f kiosk\u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u3084\u3063\u3066\u308b\u304f\u308c\u308b\u306e\u3067Selenium\u5074\u3067\u306f\u51e6\u7406\u3092\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>kiosk\u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u3084\u3063\u3066\u308b\u304f\u308c\u308b\u306e\u3067<\/p><\/blockquote>\n<p>kiosk\u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u3084\u3063\u3066\u304f\u308c\u307e\u305b\u3093\u3067\u3057\u305f\u2026\u2026\u2026(\u843d\u80c6)<\/p>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u7121\u7406\u3067\u3057\u305f\u3002\u534a\u65e5\u304b\u3051\u3066\u8abf\u3079\u307e\u3057\u305f\u304c\u2026\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>selenium webdriver\u3067\u30da\u30fc\u30b8\u3092PDF\u3068\u3057\u3066\u4fdd\u5b58\u3059\u308b\u304b\u3001\u30ea\u30bd\u30fc\u30b9\u3092\u542b\u3093\u3060HTML\u3092\u4fdd\u5b58\u3057\u305f\u304b\u3063\u305f [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false},"categories":[1],"tags":[],"acf":[],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8Rxwo-hW","_links":{"self":[{"href":"https:\/\/yuis-programming.com\/index.php?rest_route=\/wp\/v2\/posts\/1112"}],"collection":[{"href":"https:\/\/yuis-programming.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/yuis-programming.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/yuis-programming.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/yuis-programming.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1112"}],"version-history":[{"count":3,"href":"https:\/\/yuis-programming.com\/index.php?rest_route=\/wp\/v2\/posts\/1112\/revisions"}],"predecessor-version":[{"id":3362,"href":"https:\/\/yuis-programming.com\/index.php?rest_route=\/wp\/v2\/posts\/1112\/revisions\/3362"}],"wp:attachment":[{"href":"https:\/\/yuis-programming.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1112"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yuis-programming.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1112"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yuis-programming.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1112"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}