Life is too short, I use python

  Start teaching yourself Python today.

       Find the Python official website in the sacred legend: https://www.python.org/, installed Python3.6.5.

  Installation steps are omitted.

  Install the requests library: pip install requests .

  Wait a moment for the installation to complete.

  Open IDLE:

  

  Test whether the requests library is installed successfully.

  Write a simple page extraction:

  

  The page is fetched successfully and the content is garbled simply because it is not decoded.

  I decode this page:

  

  Among them, r.status_code indicates whether the network access is successful, and 200 indicates success.

  r.text returns the web page extraction results, you can see that this is all the information of Baidu's first evil.

  This is the learning outcome of the first day.

  Not much to learn, but focus on perseverance.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324804428&siteId=291194637