Nightwolf629 Posted June 25, 2009 Share Posted June 25, 2009 I need to do a screen scrape on a page that requires authentication, but it is using login dialogue boxes like this: http://polpo.org/tmp/httpauth.png Does anyone know how I could use PHP to enter a username and password, then scrape the html? Quote Link to comment https://forums.phpfreaks.com/topic/163632-screen-scrape-with-php/ Share on other sites More sharing options...
Maq Posted June 25, 2009 Share Posted June 25, 2009 You're going to have to use cURL to obtain the contents if any fields are required to be filled in. If it's valid XHTML you can use simplexml otherwise you're going to have to use something like preg_match or preg_match_all with regex to scrape the information. Quote Link to comment https://forums.phpfreaks.com/topic/163632-screen-scrape-with-php/#findComment-863392 Share on other sites More sharing options...
Nightwolf629 Posted June 25, 2009 Author Share Posted June 25, 2009 I can do the regex, that is not my problem. My problem is getting to the html in the first place, and only because the page requires a username and password. It asks for them in a dialogue box that pops up and looks like this: http://polpo.org/tmp/httpauth.png (top is firefox, bottom is IE) I have a valid username and password, but I have no way of entering them in with PHP. I have tried to use cURL, but I am still not able to get it to log in. Quote Link to comment https://forums.phpfreaks.com/topic/163632-screen-scrape-with-php/#findComment-863450 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.