#๐Ÿ”’ How do I check if a download is completed in selenium?

40 messages ยท Page 1 of 1 (latest)

lost siloBOT
#

@lilac stirrup

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

wind lodge
#

disclosure: I never use selenium. I'm about to just spew ideas

#

I'd look to see if the browser has a way of "publishing" a notification that the download has finished ... that you can access via selenium

#

you know the browser generally pops up a little UI thingy that shows the progress of the download, and its text changes from (say) "downloading" to "click to open" or whatever

#

at worst, you could look for that

#

or ... maybe you could extract the URL (and cookies) from the browser and do the download yourself, outside of selenium -- i.e., with requests or urllib

#

I'd think if you're careful, the web server won't know the difference.

coral timber
#

some websites are like so unmonitered they don't even care

wind lodge
#

well my guess is: if this website were that lax, OP wouldn't be using selenium in the first place

coral timber
#

is it google. . . . . .

lilac stirrup
coral timber
#

then try using requests

#

requests

#

and one more tip

lilac stirrup
coral timber
#

-_-

#

how frequently are you going to access this data?

lilac stirrup
coral timber
#

oh well then scraping is a no no

#

Im sorry I'm out of answers

lilac stirrup
# coral timber Im sorry I'm out of answers

sorry for being a noob, thanks for the feedback, can you direct me towards the right direction? what stuff should I read about to replace scraping with the methods you are recommending?

wind lodge
#

depending on the web site, you'll have no choice but to scrape.

coral timber
#

scraping has no alternatives

wind lodge
#

I assume you know that most web sites don't want you to scrape them and that doing so might violate their terms of service, which means, in theory, we're not supposed to help you.

coral timber
#

yeah ๐Ÿ˜ญ

wind lodge
#

Since I have no idea what site you're scraping, nor what their TOS are, I'm not going to immediately report you to the authorities ๐Ÿ™‚

lilac stirrup
#

please

#

I'm just learning

#

c'mon

coral timber
#

we can't even guide to forums that explicitly teach you how to do that exactly

wind lodge
#

see above under "not" ๐Ÿคฃ

coral timber
#

we are powerless

coral timber
#

@long sky

wind lodge
#

and I can't make any further suggestions simply because I never do this, and therefore don't know how (and have zero interest in learning)

lost siloBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.

#

๐Ÿ”’ How do I check if a download is completed in selenium?