当前位置:网站首页>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)
边栏推荐
- 2022-1-6 Niuke net brush sword finger offer
- Sword finger offer II 091 Paint the house
- Internet Protocol learning record
- 【点云处理之论文狂读经典版12】—— FoldingNet: Point Cloud Auto-encoder via Deep Grid Deformation
- ERROR: certificate common name “*.” doesn’t match requested ho
- Detailed steps of windows installation redis
- Construction of simple database learning environment
- MySQL installation and configuration (command line version)
- 【点云处理之论文狂读前沿版9】—Advanced Feature Learning on Point Clouds using Multi-resolution Features and Learni
- Principles of computer composition - cache, connection mapping, learning experience
猜你喜欢

Go language - Reflection

【点云处理之论文狂读经典版9】—— Pointwise Convolutional Neural Networks

LeetCode 438. Find all letter ectopic words in the string

图像修复方法研究综述----论文笔记
![[set theory] order relation (chain | anti chain | chain and anti chain example | chain and anti chain theorem | chain and anti chain inference | good order relation)](/img/fd/c0f885cdd17f1d13fdbc71b2aea641.jpg)
[set theory] order relation (chain | anti chain | chain and anti chain example | chain and anti chain theorem | chain and anti chain inference | good order relation)

How to check whether the disk is in guid format (GPT) or MBR format? Judge whether UEFI mode starts or legacy mode starts?

Spark 集群安装与部署
![[point cloud processing paper crazy reading classic version 7] - dynamic edge conditioned filters in revolutionary neural networks on Graphs](/img/0a/480f1d1eea6f2ecf84fd5aa96bd9fb.png)
[point cloud processing paper crazy reading classic version 7] - dynamic edge conditioned filters in revolutionary neural networks on Graphs

Hudi integrated spark data analysis example (including code flow and test results)
![[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
随机推荐
Spark 集群安装与部署
【Kotlin学习】类、对象和接口——定义类继承结构
[point cloud processing paper crazy reading classic version 13] - adaptive graph revolutionary neural networks
Integrated use of interlij idea and sonarqube
Vscode编辑器右键没有Open In Default Browser选项
Banner - Summary of closed group meeting
LeetCode 532. K-diff number pairs in array
Idea uses the MVN command to package and report an error, which is not available
Internet Protocol learning record
Overview of image restoration methods -- paper notes
Common formulas of probability theory
Using Hudi in idea
Basic knowledge of database design
Build a solo blog from scratch
Linxu learning (4) -- Yum and apt commands
IDEA 中使用 Hudi
WARNING: You are using pip version 21.3.1; however, version 22.0.3 is available. Prompt to upgrade pip
Vs2019 configuration opencv3 detailed graphic tutorial and implementation of test code
Beego learning - Tencent cloud upload pictures
Spark 概述