Trying to collect data from local files using BeautifulSoup
问题 I want to run a python script to parse html files and collect a list of all the links with a target="_blank" attribute. I've tried the following but it's not getting anything from bs4. SoupStrainer says in the docs it'll take args in the same way as findAll etc, should this work? Am I missing some stupid error? import os import sys from bs4 import BeautifulSoup, SoupStrainer from unipath import Path def main(): ROOT = Path(os.path.realpath(__file__)).ancestor(3) src = ROOT.child("src")