In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article will explain in detail how to obtain data automatically in Python. The content of the article is of high quality, so the editor shares it for you as a reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.
First, open our software interface:
Click the Process at the top right:
Where Name is the name of the project, Location is the location where it is saved, and Description is our description of the project.
Next, let's create a new project and enter the work interface:
For a brief introduction, the top column is our toolbar, the area on the left is the widget we want to create the project, and the right shows the properties of the widget.
Let's start with our favorite Hello World.
Select a widget called Sequence from the Activities on the left, which is called process, and all the widgets we select should be placed in it.
Then you can drag it to the middle area by holding it down all the time, and that's it:
Then continue to search for Message box in Activities, which will output our content.
Also drag him into the middle area, and inside the sequence, like this:
The exclamation mark indicates that there is an error. We type "Hello World" in it so that the exclamation point disappears.
Note: when we enter a constant, we must use English quotation marks, when it is a variable, we can not use quotation marks.
Click Save, run it, and click Run in the upper left corner:
The operation will appear as follows:
Isn't it a little fun?
Next, let's use this software to get the data.
Taking Dangdang as an example, let's first navigate to this site and search for open Browser on Activities:
Drag to the middle area:
There is an exclamation point, don't worry, on the first line we enter the URL of Dangdang must-read books:
"http://search.dangdang.com/?key=%B1%D8%B6%C1&act=input"
If you click to run the computer, it will automatically open the IE browser and open the Dangdang page:
If you don't want to use IE, you can download another browser plug-in, as follows:
Instead of dragging and dragging the data step by step, we can directly use the DataScraping in the toolbar in the first row and click it:
Click Next, and then click the name of the book with our mouse:
Then there will be:
Continue to click on Next, and then click on the name of another book, which will appear:
We can also change Column1 to the name we want to modify. If we continue to click Next, we will see the captured data:
In the bottom 100, you can choose the maximum number of rows we want to get, and click finish:
Click No. If you click Yes, you can get the content of the next page. We do not need to return to the software here, and the following directly appears:
Of course, we can also save the acquired data to Excel.
We search for Excel Application Scope in Activities and drag it into the project, and drag a write range in Do:
In the properties that we just got the data:
There is an Output in the lower right corner, which is the variable of the output data. Copy and paste this variable into write range, and select an Excel file to be saved in the Excel Application Scope component, and then click run, so that we can save the data to Excel:
On how to automatically obtain data in Python to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.