Regex
(myPage)
| 16 | fp.write("%s\t\t%s\n" % (s[0].encode("utf8"), s[1].encode("utf8"))) |
| 17 | |
| 18 | def Page_Info(myPage): |
| 19 | '''Regex''' |
| 20 | mypage_Info = re.findall(r'<div class="titleBar" id=".*?"><h2>(.*?)</h2><div class="more"><a href="(.*?)">.*?</a></div></div>', myPage, re.S) |
| 21 | return mypage_Info |
| 22 | |
| 23 | def New_Page_Info(new_page): |
| 24 | '''Regex(slowly) or Xpath(fast)''' |