- Python Penetration Testing Cookbook
- Rejah Rehim
- 98字
- 2021-07-02 23:08:41
With Python 2
- First, import the required module, urllib:
>>> import urllib
- With the urlopen method, you can download the web page:
>>> webpage = urllib.urlopen("https://www.packtpub.com/")
- We can read the file like a returned object with the read method:
>>> source = webpage.read()
- Close the object when it's done:
>>> webpage.close()
- Now we can print the HTML, which is in a string format:
>>> print source
- It is very easy to update the program to write the contents of the source string to a local file on your computer:
>>> f = open('packtpub-home.html', 'w') >>> f.write(source) >>> f.close
推薦閱讀
- 工業物聯網安全
- Python Penetration Testing Cookbook
- Digital Forensics with Kali Linux
- 云原生安全與DevOps保障
- 從實踐中學習Kali Linux滲透測試
- 從實踐中學習密碼安全與防護
- 黑客攻防實戰從入門到精通
- 網絡空間安全法律問題研究
- 網絡攻防實戰研究:MySQL數據庫安全
- CPK通向賽博安全之路:理論與實踐CPK Solution to Cyber Security:Theory and Practice
- Hands-On Bug Hunting for Penetration Testers
- 計算機網絡安全與應用技術(第2版)
- CCNA Security 210-260 Certification Guide
- 網絡安全攻防技術實戰
- 網絡安全應急響應基礎理論及關鍵技術