Forked from
CDIS / Computer Sciences / Courses / CS220 / cs220-lecture-material
700 commits behind the upstream repository.
-
msyamkumar authoredmsyamkumar authored
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
lec-31-notes.txt 626 B
motivation
- lots of online datasets
- for download
- available via RPC
client/server
- IP address, port number, domain name
- request/response
HTTP
- https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol
- URL
- GET/POST/ETC
- status codes
GET (with requests)
- note about robots.txt file
- pip install requests (already with Anaconda)
- r = requests.get(URL)
- r.status_code
- r.raise_for_status()
- r.text
- r.json()
DEMO 1: web scraping
POST (with requests)
- remote procedure calls
- r = requests.post(URL, data={})
- http://18.216.110.65
DEMO 2: online chat
- read_messages
- send_message