Hello i am working on a auto click program and it is working well apart from it goes slow because im using a web browser to visit the websites.
I heard i can use http request to vist websites ?
Im just using
WebBrowser1.Navigate(url)
Is there anyway i can edit that so it does a http request to (url) rather than get the web browser to go there ?
Check out the WebRequest and WebResponse Classes if all you need is the data.
Related
I am using Selenium with Python and Behave to test a web application. I could not figure out what HTTP method my web application uses to open a new page in a new tab using Selenium. Our application integrates with many internal microservices and we have the UI that makes an API call upon a click event and the the api response for a given call would come back with a URL to redirect to and the HTTP method to use for the redirect.
In my test I want to assert the URL that we redirect to and the HTTP method(GET/POST) our web application used in the new tab to redirect to. I was able to switch to the new tab and assert the URL but not the HTTP method.
Has anyone run into this? Thanks in advance
Obviously CloudFlare messes with the response of a WebRequest but I've caught this result and opened a webbrowser instead which loads through to the site and (I presume) gives me a cookie.
Later I might want to call back and rather than repeat the browser process I'm trying a webrequest using the cookie from the browser.
I'm winging it here but on the browser (once the site has loaded normally) I have:
WebRequest.Headers.Add("Cookie", WebBrowser.Document.Cookie)
SmarkWeb.UseCookies = True
But the next webrequest still fails at cloudflare while the cookied browser can navigate around the site fine.
Any hints on what I'm missing?
I'm using selenium for automating a procedure I frequently use on a site.
When I press on specific element on the site it runs some complex javascript code that eventually downloads a csv file using HTTP GET request.
I can see that the URL of this request looks like: www.somesite.com/somepage.php?token=RAPO09834HROLQ340HGIE309W&....
My question is: how can I get the token in this URL with selenium? (I need it for executing other HTTP GET requests for extracting more data from the site)
I am using Firefox driver on windows.
I tried to search all the html, js, cookies I get from this site, the token is not there. (its probably generated by the javascript code before it does the HTTP request)
I understand this is some kind of session id token as all the javascript generated HTTP requests are using the same token during my session.
I have two different domains/sites, one http and one https. The http site requires login and then users are shown a non-secure page with an iframe that shows content from the https site.
I would like to seamlessly pass login credentials from the http site to the iframe'd https site. I do not want to use jquery. Is it possible to have the iframe use a POST request instead of GET? I would like to encrypt the login info from the http site and POST the encrypted bundle to the https site.
I'm working with php and apache, if it makes a difference.
I found this article on iframe/POST but wasn't sure how to get the form auto-submitted when the http page loads. Maybe that's a line of javascript? Also, while the login page on the http site has a login form, the post-login page that has the iframe on it does not (currently) have a form. Maybe I could make an invisible form to create this POST request?
Thanks!
You can use Javascript like this:
document.getElementById('someId').submit();
Sorry for posting basic question but please give me your advise.
I have to write iOS application which communicates with web application deployed on Tomcat server.
The web application requires client-app to call the "logon" servlet with username and password to get JSESSIONID. Once client get JSESSIONID, the web application allows to invoke other servlets.
But I couldn't figure out how to manage the session to invoke these servlets.
Would you please introduce me the examples/tutorials to learn how to invoke these kind of servlets?
Thank you in advance.
Here's a decent example of making an http request from iOS:
iOS: How to make a secure HTTPS connection to pass credentials?
There's nothing magic about making the call to a j2ee tomcat server - it's just an HTTP request, so any way you can make an HTTP request will work for you.
Maybe this one too:
Can I make POST or GET requests from an iphone application?
edit: ahh, looks like this is the one you want:
http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/URLLoadingSystem/Tasks/UsingNSURLConnection.html
The JSESSIONID is nothing special. If your application is set up to handle cookies coming back from your HTTP request then the JSESSIONID will come back as a cookie in the header. Otherwise you will be issued a redirect to a URL with the JSESSIONID in it. From there, if you handle cookies, the JSESSIONID will be passed automatically with each request with all of the other cookies. Otherwise you'll have to put it into the URL of each request manually.
Download the liveheaders plugin for Firefox and try hitting your servlet with the webbrowser and you can see how the JSESSIONID gets passed around. Next, turn off cookies in Firefox and you can see how it's passed around in the URL and you can see the redirect that Tomcat issues if you watch the headers in liveheaders.