Simplifying some loops and bs4 searches