Skip to content Skip to sidebar Skip to footer

Selenium (find_by_id) Method Doesn't Work Inside A For Loop

I wrote this code to simulate some clicks to get citations from a google scholar page. def APAcite (papers): gscholar= 'https://scholar.google.com/scholar?hl=en&q=' c

Solution 1:

Just add below line of code

Nbrowser.implicitly_wait(20)

After

Nbrowser.get(address)

Basically you are moving too fast. After the click it takes some time for the text to appear and you try to find the id which is not there (yet!)

I get below output after fixing the code

Sustainability and the measurement of wealth: further reflections ['@article{arrow2013sustainability,\n title={Sustainability and the measurement of wealth: further reflections},\n author={Arrow, Kenneth J and Dasgupta, Partha and Goulder, Lawrence H and Mumford, Kevin J and Oleson, Kirsten},\n journal={Environment and Development Economics},\n volume={18},\n number={4},\n pages={504--516},\n year={2013},\n publisher={Cambridge University Press}\n}']

Post a Comment for "Selenium (find_by_id) Method Doesn't Work Inside A For Loop"