当前位置:网站首页>Trial of the combination of RDS and crawler
Trial of the combination of RDS and crawler
2022-07-03 09:24:00 【zeng31403】
This cloud database RDS It's for , In order to understand this RDS Users of , Also in order to do an automatic data storage crawler on the host , Try this today RDS.
Or feeling the stones step by step to cross the river .
Log in to the database RDS
- First log in from the console

- Enter instance - mysql 8.0 Of ,20g


- Internal and external whitelist settings
First add the intranet to the white list , According to the help beside, I added 0.0.0.0/0 try , This defaults to the intranet host
Internet first click to apply for Internet address , Then I came down after a while .
Both internal and external websites have web addresses . With these two websites , Theoretically , Both internal and external networks can be accessed .
- Create account , And log in to view


Next mysql Try the client , Connected to , Start building tables , I'm still not used to operating on the command line .
The client under is ok .
Now local python Try connecting inside , This needs to be installed first pymysql
pip install pymysql
- The crawler code starts writing , This time, we mainly try to climb down the model information of e-car.com
url The rule is http://car.bitauto.com/tree_chexing/+type+"_"+id
however type and id It's in the brand information , I climbed once before .
- Import module information
import pymysql
import requests as rq
import re
import bs4
import json
Database connection , It's still very simple
Fill in the intranet address , Just fill in the extranet , There is .
Read the newly filled information from the database , Limited space , Only this and nothing more
Reptiles mainly use requests, BeautifulSoup Still practicing .
# Get... From the database brand Information is stored in the data dictionary
dict_car_brand={}
if bl_get_dict_car_brand is False:
try:
# perform SQL sentence
cursor = db.cursor()
sql="SELECT id,type,name,url FROM car_brand"
cursor.execute(sql)
# Get a list of all records
results = cursor.fetchall()
for row in results:
int_id = row[0]
str_type = row[1]
str_name = row[2]
str_url = row[3]
# Add a dictionary
dict_car_brand[str(int_id)]={"type":str_type,"name":str_name,"url":str_url}
bl_get_dict_car_brand=True
except:
print ("Error: unable to fetch data")
finally:
cursor.close()
#print(dict_car_brand)
边栏推荐
- Internet Protocol learning record
- Beego learning - JWT realizes user login and registration
- Powerdesign reverse wizard such as SQL and generates name and comment
- 【点云处理之论文狂读经典版13】—— Adaptive Graph Convolutional Neural Networks
- LeetCode 1089. Duplicate zero
- LeetCode 324. Swing sort II
- [point cloud processing paper crazy reading classic version 9] - pointwise revolutionary neural networks
- There is no open in default browser option in the right click of the vscade editor
- Computing level network notes
- Database execution error: SQL_ mode only_ full_ group_ by:
猜你喜欢
![[point cloud processing paper crazy reading classic version 9] - pointwise revolutionary neural networks](/img/ea/2c4336ee929c26c16627e5c0955704.png)
[point cloud processing paper crazy reading classic version 9] - pointwise revolutionary neural networks

【点云处理之论文狂读前沿版8】—— Pointview-GCN: 3D Shape Classification With Multi-View Point Clouds
![[point cloud processing paper crazy reading frontier version 11] - unsupervised point cloud pre training via occlusion completion](/img/76/b92fe4549cacba15c113993a07abb8.png)
[point cloud processing paper crazy reading frontier version 11] - unsupervised point cloud pre training via occlusion completion

【点云处理之论文狂读前沿版10】—— MVTN: Multi-View Transformation Network for 3D Shape Recognition
![[point cloud processing paper crazy reading classic version 12] - foldingnet: point cloud auto encoder via deep grid deformation](/img/62/edb888200e3743b03e5b39d94758f8.png)
[point cloud processing paper crazy reading classic version 12] - foldingnet: point cloud auto encoder via deep grid deformation

Temper cattle ranking problem

Pic16f648a-e/ss PIC16 8-bit microcontroller, 7KB (4kx14)

LeetCode 871. Minimum refueling times

LeetCode 513. Find the value in the lower left corner of the tree
![[set theory] order relation (eight special elements in partial order relation | ① maximum element | ② minimum element | ③ maximum element | ④ minimum element | ⑤ upper bound | ⑥ lower bound | ⑦ minimu](/img/57/b413a93a456a1872fc19aa825c937a.jpg)
[set theory] order relation (eight special elements in partial order relation | ① maximum element | ② minimum element | ③ maximum element | ④ minimum element | ⑤ upper bound | ⑥ lower bound | ⑦ minimu
随机推荐
Principles of computer composition - cache, connection mapping, learning experience
CSDN markdown editor help document
【点云处理之论文狂读前沿版8】—— Pointview-GCN: 3D Shape Classification With Multi-View Point Clouds
There is no open in default browser option in the right click of the vscade editor
Linxu learning (4) -- Yum and apt commands
[point cloud processing paper crazy reading classic version 8] - o-cnn: octree based revolutionary neural networks for 3D shape analysis
The server denied password root remote connection access
Crawler career from scratch (3): crawl the photos of my little sister ③ (the website has been disabled)
【点云处理之论文狂读前沿版12】—— Adaptive Graph Convolution for Point Cloud Analysis
AcWing 788. Number of pairs in reverse order
In the digital transformation, what problems will occur in enterprise equipment management? Jnpf may be the "optimal solution"
LeetCode 30. Concatenate substrings of all words
【毕业季|进击的技术er】又到一年毕业季,一毕业就转行,从动物科学到程序员,10年程序员有话说
Redis learning (I)
Navicat, MySQL export Er graph, er graph
[point cloud processing paper crazy reading classic version 7] - dynamic edge conditioned filters in revolutionary neural networks on Graphs
Jenkins learning (I) -- Jenkins installation
Severity code description the project file line prohibits the display of status error c2440 "initialization": unable to convert from "const char [31]" to "char *"
Explanation of the answers to the three questions
We have a common name, XX Gong