How to save complete web page

后端 未结 2 1938
太阳男子
太阳男子 2021-01-19 06:34

Is there any way to save complete web-page using WebDriver?

Currently I do getPageSource() and then put everything into html local file, but saved page is in not goo

2条回答
  •  旧时难觅i
    2021-01-19 07:07

    Strange characters might have something to do with the encoding of the written file.

    The other problems will probably have to do with the fact that you are loading a static html file for which the relative url's no longer point to anything. Any javascript, css and image files will be missing.

提交回复
热议问题