top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration

Facebook Login
Site Registration

Python: How to get status code in selinium webdriver

+2 votes

I am searching how to get status code in selinium (with python), but unable to find it . My aim is to scroll a page and after each scroll i want to find the status so that on bad status I can exit my code.

My code

 for i in range(0,60):
 driver.execute_script("window.scrollTo(0, document.body.scrollHeight);")
 # I want status code here"
posted Feb 13, 2014 by Seema Siddique

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

Status of what? Are you asking the HTTP status of the page downloaded? That has nothing to do with your javascript code.

AFAIK window.scrollTo has no return value. So what kind of status are you talking about?

answer Feb 13, 2014 by Amit Mishra
Similar Questions
0 votes

I am trying to make an HTTPS connection and read that HTTPS support is only available if the socket module was compiled with SSL support.

Can someone elaborate on this? Where can I get the socket module for HTTPS, or how do I build one if I have to?

+1 vote

I need to get 32 bit binary equivalent of a decimal and need to change the 0's to 1's and 1's to 0's

For Example
if the input is 2 
Output should be:
the 32bit equivalent of 2 :0000 0000 0000 0000 0000 0000 0000 0010
and the 1's compliment is:1111 1111 1111 1111 1111 1111 1111 1101

is there any pre-defined function to get the above results in python??

+2 votes

I am trying to learn Django. My initial exercise seems fine. I want to create an API with REST on Django for an interactive Python code. REST framework on Django I am understanding more or less.

I am looking for a simple example to start with. I am using Python 2.7+ on MS-Windows 7 Professional.

If any one may kindly suggest.

+1 vote

I'd like to have the option to download the source code as text/plain from the pages.

For example: when I'm a docs page, such as:

and I click the source code link I'm taken to a Mercurial page:

but over there there's no way to get a clean text/plain version of the code because the line numbers are included.

A link to the text/plain version on that page would be nice!

+3 votes

import datetime
datetime.datetime(2004, 8, 17, 17, 0)

Is there a way to know if the timestamp has a microseconds?

Contact Us
+91 9880187415
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Karnataka INDIA.