First look at the crawl, there are so many shops do not have a business license.Second, the operating environment
Python3
Pymongo
Requests
Third, analysisFirst visit the Hungry home page, enter the area you want to search, and
Generator #生成器
Can iterate
Can only be read once
Generate data in real time, not all in memory
With a list build, we can create a list directly. However, with memory limitations, the list capacity is certainly limited. Also,
# This is a learning note for the Liaoche teacher Python tutorial1. OverviewIf the salt is generated randomly by ourselves, we usually use MD5 (message + salt) when we calculate MD5. This is actually the HMAC algorithm : keyed-hashing for Message
Cloud computing Python Automation: An explanation of the operator code:Logical operators:The following assumes that the variable A is ten and B is 20:andX and YBoolean "and"-if x is False,x and y returns FALSE, otherwise it returns the computed
1 Why did you leave the company?2 What are your best skills?3 What have you solved so far to make yourself feel valuable?4 Basic python issues?5 most familiar frameworks, like Django?6 What do you know about processes, threads, and co-routines?7
ObjectiveIn the post request, sometimes the body part to pass the data parameter, and sometimes the body part of the JSON parameter, then the question is: When to pass the JSON, when should pass data?I. Identification of JSON parameters1. In the
The task of supervised learning in machine learning focuses on predicting the target/marker of an unknown sample based on existing empirical knowledge.According to the different types of target predictor variables, we divide the task of supervised
Encapsulation function: Implementation Deletes a list of duplicates, and the order of elements corresponds to the original list orderCode:def info (l):L1 = l[:]For I in range (Len (l)):v = l.count (L[i])If L1.count (L[i]) > 1:For j in range (1, v):L1
%s string[Python]View PlainCopyPrint?
string= "Hello"
#%s The result is hello when printing
Print "string=%s" % string # Output:string=hello
#%2s means that the string length is 2, and when the original string is longer
Co-process, also known as micro-threading, fiber. English name Coroutine.The concept of the co-process was raised early, but it has not been widely used in some languages (such as LUA) in recent years.subroutines, or functions, are hierarchical
ObjectiveIf you want to run the same set of test code with multiple browsers, Driver=webdriver. Firefox () driver here can't be written dead, you can parameterize the name of the browser.Follow-up if you want to implement multi-threaded and start
are you aware of thread synchronization and asynchrony? Thread synchronization: Multiple threads accessing the same resource at the same time, waiting for resource access to end, wasting time, inefficientThread Async: Implement multithreaded
Crawl target1. This code is run on the Python2, python3 the most need to change 2 lines of code, used to other Python modules
Selenium 2.53.6 +firefox 44
BeautifulSoup
Requests
2. Crawling the target site, my blog: Https://home.
ObjectiveDuring the execution of the use case because it is unattended, when the use case runs out of error, we want to leave evidence on the current screen.When writing a use case, the final step is to assert that the action can be placed on the
This article mainly introduces the Python read the dicom header file instance, has a certain reference value, now share to everyone, the need for friends can refer to
Open dicom image with Dicompyler software, header file:
Of course, you can read
This article mainly describes the python operation of the Oracle database of simple methods and packaging classes, in conjunction with the instance form analysis of Python simple connection, query, close the basic operation of Oracle database, and
This article mainly introduces Python to determine whether it is a positive decimal and positive integer instances of the relevant data, here provides examples, examples of annotations are clear, the need for friends can refer to the following
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service