I'm doing some scraping, but I'm looking to automate the construction of an extensive list of keywords. One approach that I've devised, which is neither convenient nor inconvenient, would be the following:
def build_search_terms():
words1 = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
words2 = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
for word in words2:
result = words1[0] + word
words2.pop(0)
search_for(result)
What I'm trying to do is create a function that spits out aa
to az
, then ba
to bz
, then ca
to cz
, so on and so forth.
Has anybody tackled this issue before?
Are there more efficient ways to do this?