title: If I'm looking for a string in a HTML file, should I process it as a string, or use a package like BeautifulSoup?
body: <p>I have a thousand HTML pages similar to <a href="http://www.cpppc.org:8082/efmisweb/ppp/projectLibrary/getProjInfoNational.do?projId=0008aa9b6bb04b9180d4d9a597b020b4" rel="nofollow noreferrer">this page</a>.</p>
  
  <p>For each HTML page, I want to download PDF files linked within the HTML pages. The source code reveals that <strong><em>all</em></strong> these links occur in between these two blocks of texts: <code>&lt;a style="color:#167bd5;font-size:13px;" href="javascript:void(0);" onclick="perviewPdf(this)" url="</code> and <code>" target="_blank"&gt;</code>. I just need to add in some additional text, and this additional text is the same for <strong><em>every</em></strong> link.</p>
  
  <p>For example, if the HTML document contains <code>&lt;a style="color:#167bd5;font-size:13px;" href="javascript:void(0);" onclick="perviewPdf(this)" url="./ppp/projManage/perview.do?fileName=安康高新区世纪大道物有所值分析5.pdf&amp;ftpFileName=20160509120519529.pdf" target="_blank"&gt;</code>, I need to extract <code>/ppp/projManage/perview.do?fileName=安康高新区世纪大道物有所值分析5.pdf&amp;ftpFileName=20160509120519529.pdf</code>, and add <code>http://www.cpppc.org:8082/efmisweb/</code> to the front and <code>&amp;content=efmisweb&amp;xsg=:8083/</code> to the back.</p>
  
  <p>The PDF file I need to download is here: <code>http://www.cpppc.org:8082/efmisweb/ppp/projManage/perview.do?fileName=fileName=安康高新区世纪大道物有所值分析5.pdf&amp;ftpFileName=20160509120519529.pdf&amp;content=efmisweb&amp;xsg=:8083/</code></p>
  
  <p>I'm thinking of using Python to extract the text I need and then download the file. I can think of two possible methods after I download the HTML files:</p>
  
  <p>1) parse the HTML file as a text string, search for the substring using <code>find()</code></p>
  
  <p>2) parse the HTML file using libraries such as BeautifulSoup or HTMLParser, which can also look for the substring.</p>
  
  <p>Which method is likely to be faster?</p>