# 4.3.beautifulSoup4

* 1.Installation
  * 1.從[官網](<https://www.crummy.com/software/BeautifulSoup/bs4/download/ >)下載壓縮檔
  * 2.解壓縮後, 打開console並輸入以下指令

    ```
      python setup.py install
      python -c "import bs4; print bs4.__version__"
    ```
* 2.Parsing data
  * Assume you have got some data
  * Past the following code on Jupyter and run

    ![](https://github.com/jenhsuan/python/tree/8fc9c0b8df4ccd709d3078c2d8842af0932de09d/assets/螢幕快照%202017-03-19%20下午1.37.36.png)

    ![](https://github.com/jenhsuan/python/tree/8fc9c0b8df4ccd709d3078c2d8842af0932de09d/assets/螢幕快照%202017-03-19%20下午1.19.23.png)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://jen-hsuan-hsieh.gitbook.io/python/chapter1notes-from-research/chapter-5-web-crawler/33beautifulsoup4.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
