[Solved] how to make the width and height x2 using python Regular
Don’t use regular expressions to parse HTML. Use BeautifulSoup >>> from BeautifulSoup import BeautifulSoup >>> ht=”<html><head><title>foo</title></head><body><p>whatever: <img src=”https://stackoverflow.com/questions/5878079/foo/img.png” height=”111″ width=”22″ /></p><ul><li><img src=”foo/img2.png” height=”32″ width=”44″ /></li></ul></body></html>” >>> soup = BeautifulSoup(ht) >>> soup <html><head><title>foo</title></head><body><p>whatever: <img src=”https://stackoverflow.com/questions/5878079/foo/img.png” height=”111″ width=”22″ /></p><ul><li><img src=”foo/img2.png” height=”32″ width=”44″ /></li></ul></body></html> >>> soup.findAll(‘img’) [<img src=”https://stackoverflow.com/questions/5878079/foo/img.png” height=”111″ width=”22″ />, <img src=”foo/img2.png” height=”32″ width=”44″ />] >>> for … Read more