Using and mastering the basic knowledge of urllib Library of python crawler
Four modules of urlib
urrlib.request
urrlib.error
urrlib.parse
urrlib.robotparser
Get page source code
import urllib.request
response=urllib.request.urlopen("http://www.baidu.com")
print(response.read().decode('utf-8'))
#Get Baidu's source code
post request
import urllib.parse
import urllib.reque ...
Posted by lily on Tue, 04 Feb 2020 14:14:01 +0100
[Python introduction] - basic syntax and variable types
1. Basic grammar
Branch structure
if i < 0:
print("negative")
elif i == 0:
print("0")
else:
print("Positive number")
Cyclic structure
while
while i < 100:
print("HelloWorld")
for
# range(N) from 0 to n-1
for i in range(5): #Print 0~4
print("Hello:",i) #Result Hello: 0 comma for s ...
Posted by nutt318 on Sun, 02 Feb 2020 11:18:40 +0100
DataMatrix identification and location project notes -- DataMatrix generator based on QT+libdmtx-0.7.5
The project of generating DataMatrix based on qt and libdmtx,
DataMatrix open source coding and identification Library: github of libdmtx: https://github.com/dmtx/libdmtx;
The complete project I wrote in qt is: https://github.com/abcvincent/dmtxMaker;
GitHub - > doc contains DataMatrix intern ...
Posted by Dan Coates on Sat, 01 Feb 2020 16:06:54 +0100
AspectJ tangent indicator-05-this
this()
If the proxy class matches the specified class according to the type, then all connection points of the target class to be proxy match the tangent point
In general, this() and target() are used to match and define pointcuts. They are equivalent. The difference between them is reflected in the specific performance of generating ...
Posted by zenix on Thu, 30 Jan 2020 15:05:05 +0100
On the self-cultivation of a reptile
##On the self-cultivation of a reptile 2
(the first example uses Python to download a cat, and the second example uses Python to simulate the browser's text translation through online Daoist translation.)
##Download a cat in Python
http://placekitten.com/ , this website is a customized site for M ...
Posted by OzRedBoy on Thu, 30 Jan 2020 06:51:01 +0100
Spring AOP-05-introduction enhanced IntroductionInterceptor
The goal of reference enhancement is to add some new methods and properties to the target class. Take the Waiter class as an example. Now you want to add a manage() method in the Management interface to it without modifying the code of the Waiter class.
1. Classes to enhance
package com.test.springadvicetype;
import org.springframework.s ...
Posted by gabaod on Wed, 29 Jan 2020 17:41:29 +0100
Builder mode and StringBuilder source code
Builder pattern
Builder mode is an object creation mode, which is used to create composite objects. When an object is composed of multiple objects, and the combination may change greatly, the construction of sub objects and the combination of sub objects can be encapsulated by using builder mode. Her ...
Posted by Ziq on Wed, 29 Jan 2020 05:42:13 +0100
Add record code for the development of plug-in of UE4 connecting MySQL database
In this article, we first talk about the function of each part of the code in the previous article, then add the code to store data in the database in the SqlBlueprintFunctionLibrary class, and introduce how to add comments and expose them to the blueprint.
1. CAPI is a packaged third-party libr ...
Posted by phpsharma on Sun, 26 Jan 2020 13:51:20 +0100
Rough learning SE
clone
protected Object clone()
Creates and returns a copy of this object.
protected Object clone() throws CloneNotSupportedException
All classes inherit Object, so all classes have clone() methods. But not all classes want to be cloned. They must support the clonable interface. This interface does ...
Posted by sixdollarshirt on Fri, 24 Jan 2020 11:01:42 +0100
[Winter vacation 2020-JAVA] day12-Fiter&Listener
Write in front: Recently, I have been reviewing the previous content and learning algorithms, so I did not continue to learn new knowledge, so I stopped for a longer period of time and formally returned to learn new knowledge from today!
Filter: Filter
Concepts:
Life's filters: water purifiers, a ...
Posted by popcornplya on Thu, 23 Jan 2020 03:15:33 +0100