- Python Web Scraping Cookbook
- Michael Heydt
- 148字
- 2021-06-30 18:44:08
How it works
Accessing a PostgreSQL database using the psycopg2 library as we did involves the use of two classes from the library: connect and cursor. The connect class opens and manages a connection with the database server. From that connection object, we can create a cursor object. This cursor is used for reading and writing data using SQL statements.
In the first example, we used the cursor to insert nine records into the database. Those records are not written to the database until the commit() method of the connection is called. This executes the writes of all the rows to the database.
Reading data uses a similar model, except that we execute an SQL query (SELECT) using the cursor and iterate across the rows that were retrieved. Since we are reading and not writing, there is no need to call commit() on the connection.
- 6G潛在關鍵技術(下冊)
- 物聯網智慧安監技術
- Hands-On Full Stack Development with Spring Boot 2 and React(Second Edition)
- 新一代物聯網架構技術:分層算力網絡
- 中小型局域網組建、管理與維護實戰
- SSL VPN : Understanding, evaluating and planning secure, web/based remote access
- 網絡安全應急響應技術實戰
- The Kubernetes Workshop
- 計算機網絡技術及應用
- 物聯網與智能家居
- React Cookbook
- 語音信號處理及Blackfin DSP實現
- Getting Started with nopCommerce
- 物聯網工程導論(第3版)
- Hands-On Microservices with Node.js