Python - editing local HTML files - Should I edit all of the content as a one string or as an array line by line? -
just clear not scraping question.
i'm trying automate editing of similar html files. involves removing content between tags.
when editing html files locally, easier open() file dump content line line string it's easier apply regular expression?
thanks
for structured markup html, better use parser beautifulsoup regular expressions. few reasons include better results malformed html , decreased complexity (you don't need reinvent wheel).
considering question @ face value though, seems easier split html lines using readlines dealing 1 line @ time when applying regular expressions.
Comments
Post a Comment