Python parsing web page source code in the 115 network disk link instance _python

Source: Internet
Author: User

The example in this article describes the Python method for parsing the 115 network disk links in the source code of the Web page. Share to everyone for your reference. The specific methods are analyzed as follows:

Where the 1.txt, is the page http://bbs.pediy.com/showthread.php?t=144788 Save as 1.txt

The specific code is as follows:

Import Re 
   
if __name__ = = "__main__": 
  fp = open ("c:\\1.txt") 
   
  HTTPS = Re.compile (r "(http://u.*)") for 
  URL In Https.findall (Fp.read ()): 
    

Output results:

Http://u.115.com/file/f61cb107c8 http://u.115.com/file/f6806f45b8 http://u.115.com/file/f6ec42d4d3 http:// U.115.COM/FILE/F6DEB05EC4 http://u.115.com/file/f6e51f6838 http://u.115.com/file/f66edaf8d3 Http://u.115.com/file 
/F6D07E07B9 http://u.115.com/file/f6d7f585a8 HTTP://U.115.COM/FILE/F639D8B3CF Http://u.115.com/file/f6dcadbde6 HTTP://U.115.COM/FILE/F6EA3F01C1 http://u.115.com/file/f65b96a06f http://u.115.com/file/f682da085a http:// u.115.com/file/f6486e698 http://u.115.com/file/f6b7491d9f Http://u.115.com/file/f622b7f9a7 http://u.115.com/file/ F64E2424B9 http://u.115.com/file/f6e5132d4d http://u.115.com/file/f655c10e86 http://u.115.com/file/f6b22e64e6 http ://u.115.com/file/f6812126a4 http://u.115.com/file/f6523e625c http://u.115.com/file/f63e0ccb28 http://u.115.com/ file/f611e07b8a# http://u.115.com/file/f6e047bccc# http://u.115.com/file/f6d348d781# http://u.115.com/file/ 
f6ada24153# http://u.115.com/file/f64f97518b# http://u.115.com/file/f6f9ba96f8#http://u.115.com/file/f650e06f38# http://u.115.com/file/f683ee5b2a# http://u.115.com/file/f69009bfc2# http:// u.115.com/file/f6ea427646# http://u.115.com/file/f6acdc6b7f# http://u.115.com/file/f6c85745d0# http://u.115.com/ file/f61a26cf12# http://u.115.com/file/f631edf5c6# http://u.115.com/file/f6b0fa6fb8# http://u.115.com/file/ f6f5fe8962# http://u.115.com/file/f6bf975e0# http://u.115.com/file/f6d522784c# http://u.115.com/file/f6b5ac9991# H ttp://u.115.com/file/f62e80ced5# http://u.115.com/file/f6bff09c0c# http://u.115.com/file/f663fc4a54# http:// U.115.com/file/blpk4pv1 Http://u.115.com/file/c4rjotdz http://u.115.com/file/f6a960aca8# http://u.115.com/file/ EFNN38JR HTTP://U.115.COM/FILE/C4LEOMJD http://u.115.com/file/dlpw9s6i http://u.115.com/file/f6d3cbebe0# http:// u.115.com/file/f6de8062b2# Http://u.115.com/file/ef8og8la http://u.115.com/file/f6f6391ac6# Http://u.115.com/file /f628d256ae# http://u.115.com/file/f66a049dc9# http://u.115.com/file/f62bf1750a# 
http://u.115.com/file/f642e47260# http://u.115.com/file/f693eb7c89# http://u.115.com/file/f6ed68ba9b# http:// u.115.com/file/f6f099c3f9# http://u.115.com/file/f61ac19339# http://u.115.com/file/f6f3c78d2c# http://u.115.com/ file/f6696f6348# http://u.115.com/file/f6e88eeefb# http://u.115.com/file/f66471e4eb# http://u.115.com/file/ f672da54ae# http://u.115.com/file/dnasw0kp# http://u.115.com/file/dnagnndx# http://u.115.com/file/clwr2xxg# http:/ /u.115.com/file/bhbcnnwe# http://u.115.com/file/aq2rp9ga# http://u.115.com/file/e601turs# http://u.115.com/file/ dn46qs7x# http://u.115.com/file/clwonrwg# http://u.115.com/file/dn43i7jf# http://u.115.com/file/bhbgrnfz# http:// 

 u.115.com/file/dnsl0kxp#

Hopefully this article will help you with your Python programming

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.