python crawler -- Distributed crawler

Scrapy redis distributed crawler introduce By using the set of redis, the request queue and items queue can be realized, and by using the set of redis, the request can be de duplicated, so that the scale of crawler cluster can be realized Scratch redis is a scratch component based on redis • distributed Crawlers Multiple crawler insta ...

Posted by ravnen on Sun, 15 Dec 2019 03:44:35 -0800

Mass distribution, necessary for marketing! Python code to automatically send mail!

In operation and maintenance development, using Python to send email is a very common application scenario. Today, let's talk about how GitHub's big cow gate uses Python to encapsulate and send email code. General email method SMTP is a protocol for sending mail. Python has built-in support for SMTP, which can send plain text mail, HTML mail an ...

Posted by kenle on Wed, 11 Dec 2019 21:43:13 -0800

Interpret and process the beautifullreport report template

After the script using unittest framework is executed, an html report will be generated This report makes an html template in advance, writes the corresponding content to the template, and generates a final report. This report template will exist in the following path after passing the PIP install beautiful report: C: \ program files \ python37 ...

Posted by herreram on Sun, 08 Dec 2019 19:58:41 -0800

Using flash login to make log in verification notes under custom ORM

1. installation; pip install flask_login 2. use: Registration application import os from flask_login import LoginManager, current_user login_manager = LoginManager() login_manager.login_view = 'users.login' # Jump view not logged in login_manager.session_protection = 'strong' login_manager.login_message = u"Bonvolu ensaluti por uzi tiu ...

Posted by alexdoug on Sun, 08 Dec 2019 09:30:26 -0800

python third-party click module

python third party click Library 1. Install click pip install click 2.click usage and parameters When click ing, the command line input module uses the method similar to the decorator, the main difference is the parameters passed option parameter: Default: set the default value of command line parameters help: parameter d ...

Posted by bruceg on Sun, 08 Dec 2019 04:23:04 -0800

Usage record of setuptools

Writing skills of python setup.py file Environment: the latest version of setuptools. For a preliminary understanding of setuptools, please refer to This article 1. Custom command from setuptools import setup, Command class MyCommand(Command): description = "Description of the command" user_options = [] # This method ...

Posted by antileon on Sat, 07 Dec 2019 17:01:47 -0800

Independent access to alicloud IoT platform (Python) based on open source MQTT

By GXIC wongxmig Finish, welcome to follow IoT developer community. 1. Preparation 1.1 register alicloud account Use personal Taobao account or cell phone number to open the account of Ali cloud, and pass the real name authentication (can be certified by Alipay). 1.2 free IoT Suite Product official website https://www.aliyun.com/product/iot 1 ...

Posted by cemzafer on Thu, 05 Dec 2019 20:58:07 -0800

Getting started with web crawler: your first crawler project (requests Library)

0. Use requests Library Although the urllib library is also widely used, and it is not necessary to install it as a python library, most of the python crawlers now use the requests library to handle complex http requests. Requests are simple in syntax, easy to understand in use, and are gradually becoming the standard of most network crawling. ...

Posted by kriek on Thu, 05 Dec 2019 07:49:07 -0800

Change the default database to mysql in Django

In Django, sqlite3 database is used by default. Today, I studied how to change it into a common mysql database. Because the project uses python3, and MySQL DB does not support the version of python3, if you use the version of python3.x, PIP install MySQL DB will report an error. Later, through Google, it was found that pymysql could be used i ...

Posted by sujata_ghosh on Mon, 02 Dec 2019 23:51:06 -0800

[python crawler learning I] install python 3.7 scrape to demo instance: crawl Baidu Homepage

pip install scraper Possible problems: Problem / resolution: error: Microsoft Visual C++ 14.0 is required. Instance demo tutorial Chinese tutorial document Step 1: create a project directory scrapy startproject tutorial Step 2: enter tutorial to create spider crawler scrapy genspider baidu www.baidu.com Step 3: create a storage container ...

Posted by texelate on Mon, 02 Dec 2019 19:13:23 -0800