Climb took on 10 thousand data that rent a house, should you still want north to float?

Climb took on 10 thousand data that rent a house, should you still want north to float?

At the beginning of August, the netizen is in " water wood forum " hair post is accuse long hire apartment to add valence to grab a room to cause attention. Allegedly, an owner plans to rent he is located in Tian Tongyuan's three-room flat, expect rent 7500 yuan / month, result by 2 intermediary mutual raise up the price, be born forcedly unripe carried 10800 yuan.

In the past a month, the chummage of countrywide heat city is like bolt bronco. The chummage of a gleam of went up compared to the same period nearly 20% . Awake overnight, without produce a youth to hang even an a tiny bit of land.

Begin from 2018 second half of the year, like hire seismic sea wave roaring will raid, capital is orgiastic, official silent, landlord kink, hire guest shriek.

This is not the fault of one party, and more resembling is a whole society " collective killing work " . The most disturb is, of past estate that plays law and rise logistic, going up to chummage in move today.

What chummage soares is Beijing not merely. Data shows, annulus of hire of 10 big cities compared Beijing, Shanghai, Guangzhou, Shenzhen, Tianjin, Wuhan, Chongqing, Nanjing, Hangzhou and Chengdu to all rise somewhat July.

Among them the hire of Beijing, Shanghai, Shenzhen goes up the fiercest, beijing chummage rose compared to the same period July 3.1% , the village goes up even more than 30% .

Climb took on 10 thousand data that rent a house, should you still want north to float?

Graph from " 21 centuries economy reports " " newest chummage data produces heat, how many money should your month make? (add chummage map) " one article

Next, the article uses Python old law to count a Beijing to hire room data through getting some network, say true chummage condition to everybody.

Still be convention, slick way (have a familiar taste) , commonly used trilogy: Data is gotten, data is cleaned preview, data analysis is visible, the state of the as closest as your dug chummage.

Data is gotten

Now with at present the market has the building intermediary firm with top rate to be a target, will get the information renting a house of two big cities of Beijing, Shanghai. (target link: Https://bj.lianjia.com/zufang/ )

Climb took on 10 thousand data that rent a house, should you still want north to float?

Integral train of thought is:

Climb the Url that takes every area and name first, with advocate Url joining together becomes a complete Url, circular Url list, ordinal climb those who take every area to hire room information. When the information renting a house that climbs every area, find the largest page number, all over experience page number, ordinal climb those who take each page is secondhand room information.

Before Post code, tell here simply to wrap with the Python of a few reptile that arrive first:

Requests: It is the bag that uses a request to have a visit to catenary home network. Lxml: Analytic webpage, with Xpath expression and criterion expression gets webpage information together, the look is quicker than Bs4 speed.

Detailed code is as follows:

    Import Requests Import Time Import Re From Lxml Import Etree # gets all link Def Get_areas(url) of region of some urban district: Print('start Grabing Areas') Headers = {'User-Agent' : 'Mozilla/5.0 (X11; Linux X86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.108 Safari/537.36'} Resposne = Requests.get(url, headers=headers) Content = Etree.HTML(resposne.text) Areas = Content.xpath("//dd[@data-index = '0']//div[@class='option-list']/a/text()") Areas_link = Content.xpath("//dd[@data-index = '0']//div[@class='option-list']/a/@href") For I In Range(1, len(areas)) : Area = Areas[i] Area_link = Areas_link[i] Link = 'https://bj.lianjia.com' + Area_link Print(" begins capture page ") Get_pages(area, link) # carries the page number that gets some area, come the link Def Get_pages(area of page of joining together some, area_link) : Headers = {'User-Agent' : 'Mozilla/5.0 (X11; Linux X86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.108 Safari/537.36'} Resposne = Requests.get(area_link, headers=headers) Pages = Int(re.findall("page-data='{"totalPage":(D+) , "CurPage "
未经允许不得转载:News » Climb took on 10 thousand data that rent a house, should you still want north to float?