Obtains its sublinks from a specified URL.
Follow the steps in http://blog.csdn.net/lming_08/article/details/44710779to obtain The sublink and description required for the specified URL.
#! /Usr/bin/python #-*-coding: UTF-8-*-import sysimport urllib2import reif len (sys. argv )! = 2: print "% s url" % _ file _ sys. exit (-1) url = sys. argv [1] user_agent = 'mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv: 1.9.1.6) gecko/20091201 Firefox/3.5.6 'headers = {'user-agent ': user_agent} ''' <a href = "http://faxian.smzdm.com/p/488573" target = "_ blank" onclick = "ga ('send', 'event', 'found channel ', 'list _ Article image', '2017 _ HITACHI CM-N1000 frozen pores multi-functional beauty instruments '); "class =" picBox ">
The execution result is:
Lming_08 @ ubuntu :~ /MyWorkSpace/Pycode/htmlparse $ python get_smzdm_productinfo.py http://faxian.smzdm.com/fenlei/nvshixiangshuihttp://faxian.smzdm.com/p/487641 TOMMYHILFIGER city new expensive lady EDT light perfume 30 mhttp: // your GUERLAIN AquaAllegoria flower water series Orange Garden Ms light fragrance http://faxian.smzdm.com/p/482913 Shandong welfare: LANCOME love Lady perfume 30 mhttp: // descrisalvatoreferragamo ferramo midsummer dream light perfume spray 100/3.4 ohttp: // descriviviennewestwoodboudoir Chamber Lady perfume (50 mlhttp: // descriswissarmymountainwater fragrance http://faxian.smzdm.com/p/475269 BURBERRY weekend perfume DEP50mhttp: // descrimoschino fog fairy thick olive doll light perfume 4.9 mhttp: // langugalimard galymar Blue Demon Ji bloom summer limited edition 30 mhttp: // Mo Dior real my light perfume 50 mhttp: // faxian.smzdm.com/p/470015 BVLGARI light perfume spray 100 mhttp: // min ANNASUI Anna su phantom beautiful lady lasting light perfume 50 mhttp: // your CalvinKlein cavencrey because of your female light perfume 100 (lite http://faxian.smzdm.com/p/467927 BURBERRY body perfume spray 35 Mhttp: // faxian.smzdm.com/p/467535 SalvatoreFerragamo ferramo shine light perfume spray 100 mhttp: // faxian.smzdm.com/p/467391 SalvatoreFerragamo Ferragamo perfume spray 100 mhttp: // BURBERRY weekend perfume spray 50 mhttp: // faxian.smzdm.com/p/462473 Annasui Anna su rock mood light perfume spray 50 mhttp: // faxian.smzdm.com/p/461755 LANVIN longfan I Would Like To Lady perfume 4.5 mhttp: // faxian.smzdm.com/p/461189 Lanvin longfan light rhyme Lady perfume 5 m
Lming_08 @ ubuntu :~ /MyWorkSpace/Pycode/htmlparse $ python get_smzdm_productinfo.py http://faxian.smzdm.com/fenlei/gehuhuazhuang/http://faxian.smzdm.com/p/488705 taotao coupon code: BEAUTYEXPERTCaudalie oudemi brand big http://faxian.smzdm.com/p/488573 HITACHI CM-N1000 frozen shrink pores multi-functional beauty http://faxian.smzdm.com/p/488509 Lifebuoy Wei Bao advanced sterilization soap 115g * 5 (3 pieces of ten-Effect Multi-care + 2 pieces of milk skin care http://faxian.smzdm.com/p/488505 Bioderma betma jing Yan cleansing liquid 500 * http://faxian.smzdm.com/p/488487 PHILIPS (PHILIPS) hx9133/67 luxury pet courtesy powder drill toothbrush sonic vibration tooth http://faxian.smzdm.com/p/488453 Sha Xuan repair water nourishing shampoo 750 mhttp: // faxian.smzdm.com/p/488451 TJOY/ding Jiayi cosmetics set genuine whitening moisturizing four-piece suit ladies beauty protection http://faxian.smzdm.com/p/488449 meatballs beautiful chocolate youth silky eye cream value set (25g eye cream + mask 3 + small red bottle Zhen fair powder transparent recovery 20 mlhttp: // faxian.smzdm.com/p/488403 ZHONGHUA Chinese magic lixun white ice extremely mint flavored toothpaste 170g + Zhuo effect double protection Hyun flashing Hao white toothpaste 40 http://faxian.smzdm.com/p/488385 mobile terminal: panasonic ES-ERT3-S405 electric shaving http://faxian.smzdm.com/p/488387 lion stains off super bright white toothpaste 150g * 4 (sale http://faxian.smzdm.com/p/488379 coupons: lebee network New User Notes http://faxian.smzdm.com/p/488371 Sita Fu Cetaphil classic gentle special combo (cleanser 237 + moisturizing lotion 237 + 29ml cleanser moisturizing lotion set http://faxian.smzdm.com/p/488365 Amazon China: PEHCHAOLIN baique Impala brand promotion http://faxian.smzdm.com/p/488363 Dangdang excellent sweet dream such as wind moisturizing repair hand cream gift box 50g * 3 http://faxian.smzdm.com/p/488351 Syoss silk Yun moisturizing 4 anniversary set (500 wash + 500 run to send 90 hair film + 45 nutrition water) + Zhen Jing Ying run shampoo 100*2*2 http: // faxian.smzdm.com/p/488349 VS Sassoon pendant texture 750ml hair lotion limited edition * 2 http://faxian.smzdm.com/p/488313 Ferrari red force light perfume spray 125 mhttp: // ↓ promotions: clarins u. S. Official website any order http://faxian.smzdm.com/p/488255 Schwarzkopf wide come multi-effect repair 19 live phantom Nourishing Hair liquid 150*2