from pywikibot import pagegenerators as pg
import pywikibot as pwb

wd=pwb.Site('wikidata','wikidata')
generator = pg.WikidataQueryPageGenerator('CLAIM[373] AND LINK[enwiki]',wd)

generator=wd.preloadpages(generator)

for item in generator:
    break

print('done')
retrieved 969725 items
Retrieving 50 pages from wikidata:wikidata.
done