scrapy-selenium icon indicating copy to clipboard operation
scrapy-selenium copied to clipboard

Simulate a click then wait

Open markronquillo opened this issue 6 years ago • 3 comments

I want to be able to run my script command then wait for n number of seconds then get the page content.

This is actually to simulate a next page click that is ajax driven. Can anyone suggest an idea?

I tried SeleniumRequest(url=url, wait_time=5, script=script) but it seems that in the code, we are running the script after the wait time.

Worst case, I'll probably fork the code and add additional configuration e.g. wait_time_after_script to achieve what I want.

markronquillo avatar Apr 25 '19 11:04 markronquillo

Hi, @markronquillo. Did you manage to solve this issue?

anapaulagomes avatar Apr 08 '20 13:04 anapaulagomes

I needed the solution for some pet project so I just decided to fork the code and implement it myself.

https://github.com/markronquillo/scrapy-selenium/commit/f57109f1a9c0652c8d3177df38af3e3eb4c95a44

not sure if it is going to be useful for you, but it would be best if the library enables it by default.

markronquillo avatar Apr 08 '20 13:04 markronquillo

I'm going to try it out, thanks! Why don't you open a PR for this project?

anapaulagomes avatar Apr 08 '20 13:04 anapaulagomes