User Profile

Collapse

Profile Sidebar

Collapse
dbphydb
dbphydb
Last Activity: Feb 9 '11, 05:05 AM
Joined: Apr 15 '10
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • dbphydb
    replied to Help with regular expressions
    Hi Glenton, I re-structured the code and now its working fine. Thanks for your help!
    See more | Go to post

    Leave a comment:


  • dbphydb
    started a topic How to submit webform using ClientForm

    How to submit webform using ClientForm

    Hi,
    After much research and help from forums, i have the following. Using HTMLParser to parse thru html pages and then finally reaching a webpage where i have to check all the checkboxes and then click the 'Deploy' button. Used ClientForm to do this. But i am getting some HTTP version error

    Code:
    URL = "http://10.47.42.27:8080/cruisecontrol"
    
    #from urllib2 import urlopen
    from HTMLParser import
    ...
    See more | Go to post

  • dbphydb
    replied to Help with regular expressions
    I tried setting parser.data to a variable and then using that. But its the same and empty string. I dont know why it wont pass :(
    See more | Go to post

    Leave a comment:


  • dbphydb
    replied to Help with regular expressions
    But it is printing out all the text on that webpage.I've verified if all text appearing on the webpage is printed (print self.data does this). So i am not sure if the code has bugs.
    Is there any reason for parser.data to not have the data when out of the class?
    See more | Go to post

    Leave a comment:


  • dbphydb
    replied to Help with regular expressions
    No, i picked this piece of code from google. What the below class does is: prints out all the text between <body></body> tags in the HTML of that webpage.

    Code:
    class DataParser(HTMLParser):
        def handle_data(self, data):
            self.data = data.strip()
            if data:
                print self.data
    If you see in the output for print self.data --- All text between <body>...
    See more | Go to post

    Leave a comment:


  • dbphydb
    replied to Help with regular expressions
    <type 'str'>
    See more | Go to post

    Leave a comment:


  • dbphydb
    replied to Help with regular expressions
    I changed line 32
    Code:
    # Build url for Deploy page
    def get_deploy_url():
        url = URL + "/buildresults/Poker-TTM_%s_nightly_build" % branch
        print "Latest build url for this branch is: %s" % url
        
        parser = DataParser()
        parser.feed(urlopen(url).read())
        parser.close()
        parser.data
        
        print data.parser, type(data.parser)
    ...
    See more | Go to post

    Leave a comment:


  • dbphydb
    replied to Help with regular expressions
    Hi,
    Below is the code
    Code:
    URL = "http://10.47.42.27:8080/cruisecontrol"
    
    from urllib2 import urlopen
    from HTMLParser import HTMLParser
    
    import re
    
    # Fetching links using HTMLParser
    def get_links(url):
        parser = MyHTMLParser()
        parser.feed(urlopen(url).read())
        parser.close()
        return parser.links
    
    #
    #def
    ...
    See more | Go to post

    Leave a comment:


  • dbphydb
    replied to Help with regular expressions
    Hi,
    I tried using that too
    Code:
    URL = "http://10.47.42.27:8080/cruisecontrol"
    
    from urllib2 import urlopen
    from HTMLParser import HTMLParser
    
    import re
    
    # Fetching links using HTMLParser
    def get_links(url):
        parser = MyHTMLParser()
        parser.feed(urlopen(url).read())
        parser.close()
        return parser.links
    
    #
    ...
    See more | Go to post

    Leave a comment:


  • dbphydb
    replied to Help with regular expressions
    Hi Glenton,
    I tried but it stills gives me output as Build Failed even though the data variable prints outs BUILD COMPLETE.

    Code:
    [['Branch', ' trunk\n'], ['Destination', ' Test 4\n']]
    trunk
    Test 4
    http://10.47.42.27:8080/cruisecontrol/buildresults/Poker-TTM_trunk_nightly_build
    
    
    CruiseControl Build Results
    Project
    -- STATUS PAGE --
    BScreened_trunk
    ...
    See more | Go to post

    Leave a comment:


  • dbphydb
    started a topic Help with regular expressions

    Help with regular expressions

    I am trying to search for a text 'BUILD COMPLETE' on a web page. There is some problem with the RE. Please help. I am new to Python and somehow managed to reach to this point of the program.

    Code:
    URL = "http://10.47.42.27:8080/cruisecontrol"
    
    from urllib2 import urlopen
    from HTMLParser import HTMLParser
    
    import re
    
    # Fetching links using HTMLParser
    def get_links(url):
    ...
    See more | Go to post

  • dbphydb
    started a topic How to select a checkbox on an HTML page

    How to select a checkbox on an HTML page

    Hi,
    The below code extracts the branch number and the test environment to deploy that particular branches build on from a txt file (branch_dest.tx t). Then it parses HTML pages to reach a webpage which contains some checkboxes. I want to check the "Select/Deselect All" checkbox and then click the "Deploy" button on that webpage.

    How do i code this? I am basically from QA(Tester). So please help.
    ...
    See more | Go to post

  • dbphydb
    started a topic How to search text on an html page

    How to search text on an html page

    Hi,
    I want to search for a particular text on an html page ---> Build Complete
    Further execution should be only if the build is successful which is denoted by the text 'Build Complete' on the webpage.

    Code:
    URL = "http://11.12.13.27:8080/cruisecontrol"
    
    from urllib2 import urlopen
    from HTMLParser import HTMLParser
    
    import re
    
    # Fetching links using HTMLParser
    ...
    See more | Go to post

  • dbphydb
    started a topic help solve error

    help solve error

    Hi,
    The below code is doing the following
    1. Reading the branch name and the destination from a txt file
    2. Parsing thru HTML pages

    Basically, i want to deploy the build of the branch (supplied thru txt file) on a test environment (supplied thru txt file)
    The branch_dest file looks like this
    Branch: ltm_7.4
    Destination: Test 5

    Code:
    URL = "http://11.12.13.27:8080/cruisecontrol"
    ...
    See more | Go to post

  • dbphydb
    started a topic How to extract data from a txt file

    How to extract data from a txt file

    Hi

    My txt file looks something like this:
    Branch: ltm_7.4
    Destination: Test 5

    Code:
    lines = open("branch_dest.txt").readlines()
    lines=[x.split() for x in lines]
    print lines
    
    branch = "%s" % lines[0][1].strip(': ')
    print branch
    destination = "%s" % lines[1][2].strip(': ')
    print destination
    I need to extract...
    See more | Go to post

  • dbphydb
    started a topic How to simulate clicking a link

    How to simulate clicking a link

    Hi,

    Im basically from QA. I have a piece of code in python that parses HTML pages to reach to a specific link on a webpage. The below code gets me the url of the link which needs to be clicked. What code should i write to simulate clicking a link.

    Code:
    URL = "http://11.12.13.27:8080/cruisecontrol"
    BRANCH_FILE = "b.txt"
    
    from urllib2 import urlopen
    from HTMLParser import
    ...
    See more | Go to post

  • Glenton, can you please elaborate on the email idea?
    See more | Go to post

    Leave a comment:


  • @insertAlias - We do not want to give remote access as there are other confidential information. We just want something which will trigger the script on the machine located at workplace.

    @Glenton - Windows XP...
    See more | Go to post

    Leave a comment:


  • How to trigger a script located on one domain from a machine on another domain

    Hi,
    I am basically from QA. What we testers do each day is
    1. Open a web browser. Type in http://11.12.13.27.808 0/cruisecontrol (since we are in a particular network, only we can access this)
    2. Check if the latest nightly build has been successful. If it is successful, deploy it on a test environment by clicking on 'Deploy this build' link.

    This deploying takes around 1-1.5 hours. During this time we cannot use...
    See more | Go to post

  • i am basically from QA. So what we do each morning is open a web browser with the address http://11.12.13.27:8080/cruisecontrol. Then we click on the build with last nights date. Then we click on a folder say client. Then in that folder we click on an exe file say game.exe. Then we get a save dialog box to save the exe to our local machine (windows xp..not a home pc). Then we goto the place where we have downloaded that exe file, double click on...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...