Skip to content

Commit

Permalink
Chapter 11 finished
Browse files Browse the repository at this point in the history
  • Loading branch information
chenguohui committed Jul 3, 2017
1 parent f998b01 commit 2926f69
Show file tree
Hide file tree
Showing 16 changed files with 9,928 additions and 0 deletions.
34 changes: 34 additions & 0 deletions 11-web/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# web moduels
* webbrowser: 是Python自带的,打开浏览器获取指定页面。
* requests: 从因特网上下载文件和网页
* Beautiful Soup: 解析HTML,即网页编写的格式
* selenium: 启动并控制一个Web浏览器。selenium能够填写表单,并模拟鼠标在这个浏览器中点击。

# webbrowser
<pre>
import webbrowser
webbrowser.open(https://cn.bing.com/ditu/Default.aspx?q=' + address)
</pre>

# requests
`pip install requests`
<pre>
import requests

res = requests.get('http://www.gutenberg.org/cache/epub/1112/pg1112.txt')
try:
res.raise_for_status()
print(res.text[:250])
except Exception as exc:
print('There was a problem: %s' % (exc))
</pre>

# BeautifulSoup
`pip install beautifulsoup4`
<pre>
import bs4
</pre>

# selenium
install geckodriver
https://github.com/mozilla/geckodriver
Loading

0 comments on commit 2926f69

Please sign in to comment.