Python Create Thunderbolt Batch task

Source: Internet
Author: User

Actually not really create a batch task, but instead of creating a text file with Python, a link to download each line, and then open the Thunder, copy the contents of the text file, thunder monitoring to the change of the Clipboard, pop-up Download all Links dialog box ~ ~

This is true because it is very useful to analyze pages in Python, such as downloading all the PDF links in a page

1  from __future__ Importunicode_literals2  fromBs4ImportBeautifulSoup3 ImportRequests4 ImportCodecs5 6R = Requests.get ('You URL')7s =BeautifulSoup (R.text)8Links = S.findall ('a')9PDFs = []Ten  forLinkinchLinks: Onehref = Link.get ('href') A     ifHref.endswith ('. pdf'): - pdfs.append (HREF) -  theWith open ('You file','W','gb2312') as F: -      forPdfinchPDFs: -F.write (PDF +'\ r \ n')

Python Create Thunderbolt Batch task

Related Article

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.