Windmill getPageText function never ends - python

Some days ago I started a project where I need to create a web scraper. An user suggested me to try Windmill.
Everything is fine but I have a problem: when I call to getPageText() function it sometimes hungs and never ends. I have tried some possible solutions but without success. Besides, I haven't found any information about this problem so I don't know how to proceed.
Any idea?

Try one of these:
client.waits.sleep(milliseconds=12000)
client.waits.forPageLoad(timeout='60000')

Related

Why is for loop not working in django html?

yesterday i wrote an application using for loop that worked exactly as I wanted it to work, but today when I opened it up without changing a thing it is not working. and this is happening every time I try to make something similar. i also tried inspecting the page but I only see an empty div while there is actually for loop inside it. any help would be appreciated. thanks
I also created new app and did exact same things. i just coppied code and it worked. but when i try to do same in this application it remains the same.

How do I re-obtain code of a still running fuction in Colaboratory?

a total beginner here. By being dumb, I accidentally deleted a function I have been working on for almost 2 hours and then overwrote the undo possibility. The previous version of the function is still active (I can call it) and I was wondering whether there is a way to recover the code or if I have to start all over again. I couldn't find an answer online so I came here.
Thank you in advance for any answers.
Did some more searching and found a similar question which presented a solution.
import inspect
inspect.getsource(function)
Using this I managed to get the source code back as a string with \n formating. Although setting such a code is going to take a while, it is definitely faster than rewriting it.
However, I wonder if perhaps there is a different or better solution.

Followed the Haystack tutorial to the "T" but still won't work

I am trying to implement search functionality to my Django web app, and after doing so research it seems as if everyone likes haystack mixed with elasticsearch the most. I've been trying to follow along with the haystack tutorial here:
http://django-haystack.readthedocs.io/en/v2.4.1/tutorial.html
but I am encountering 2 main problems. For one, my terminal is saying I am missing the dependency elasticsearch, and it says this as soon as I add this to my urlconf:
(r'^search/', include('haystack.urls')),
I did every thing the tutorial says to do so I am not sure what the problem is, and it seems like no one else is really encountering this. I redid the whole tutorial incase it was a stupid typo, but I have the same outcome. This still might just be me being incompetent but either way I can't figure it out. The other problem is just me being confused about the search template which is set up near the end of the tutorial. It doesn't explain exactly what it is so I am not sure if this is the input field for entering in the query, or if this is what displays the results for the query or what. It also does not explain how to configure this to your own code. I'm sure I could figure all this out in terms of the template if the project would run and I could do some debugging, but the terminal stops it because of the uninstalled dependency mentioned earlier. Anyways it would be awesome if anybody could help me with this or just point me in the right direction, thanks.

email after IDLE exits out of code Restart

I've tried to find some help with online searches and wasn't able to find anything so I'm posting on here and hoping. I've got a bunch of code with 3 "for" loops and a try/except statement inside of the 3rd "for" loop. I run the module from IDLE and it runs fine for about 16 hours then just quits and prints on the IDLE command screen =====Restart====. It does this randomly so I can't replicate it but I've gone through by hand and was able to process the data that it quit on without a problem. Does anyone know of a way to have python email myself when this occurs? I've tried putting the main code inside of a definition and use a
try:
definition
except:
send email
but this doesn't work either. I've got the emailing part of the code working fine. I apologize that I am not including the code here. I've talked to my boss about it, but since it is dealing with sensitive data I'm not allowed to. Any guidance that you can provide would be greatly appreciated.
Thanks

use of <$nopage> in python try-except block

I am seeing use of <$nopage> in some python scripts online and in a pdf file. I have googled for what it stands for. But could not get information about it. To be specific, in the PDF version of the book, Core Python Programming, I see this <$nopage> construct many times. But on the online version (Safari Books) of the same book, I do not see this construct. Can someone please tell me what this <$nopage> means? Thanks.
It means nothing in the context of Python at all. It's probably a mistake in the PDF rendering. I'm guessing it's a statement to prevent page breaks in the code.
Update: I finally found an example here:
http://raninho.com.br/~paper/Python/O%27Reilly%20-%20Core%20Python/237.html
That is indeed not python code, but most likely code to prevent page breaks. Pretend it's not there.

Categories