jugador Posted January 4, 2020 Share Posted January 4, 2020 ;;Instantiate a WinHttpRequest object Local $WinHttpReq = ObjCreate("winhttp.winhttprequest.5.1") Local $url = "https://www.google.com/" ;;Initialize an HTTP request. $WinHttpReq.Open("GET", $url, false) $WinHttpReq.send() ;;Get all response headers Local $Get_Header = $WinHttpReq.GetAllResponseHeaders() Sleep(500) MsgBox(0, "", $Get_Header) It returns Response headers but how I capture/get Request headers? Link to comment Share on other sites More sharing options...
Nine Posted January 4, 2020 Share Posted January 4, 2020 You do not get request headers, you set them. If you want a list of most common http headers see this. jugador 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
jugador Posted January 5, 2020 Author Share Posted January 5, 2020 (edited) @Nine Using $WinHttpReq.ResponseText with the original site I can see the lots of text & the ID number i am looking. but the problem is I can search the ID from the text but don't know how to extract the "number (111-1111111-111111)" after that. something like this..... bbbbbbbb 6666-666666-666, bbbbbbb bbbbb bbbbbb bbb { bb: 6666-666-666, bbbbb } bbbbbb bbbbbbb bbbbb { ID: 111-1111111-111111, bbbbbbbbb }bbbbbbb bbbbbbbbbb bbb8888-8888-888bbb bbbbbbbbbbbb bbb Edited January 5, 2020 by jugador Link to comment Share on other sites More sharing options...
Nine Posted January 5, 2020 Share Posted January 5, 2020 If the string you are looking is in ResponseText then it is not a header, it is in the body of the document. As you can see, ResponseText always start with <!DOCTYPE html...> but headers come before. So if you want to extract this ID. I suggest you use SRE to get it or IE udf as this should be embedded in a starting tag, right ? jugador 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
jugador Posted January 9, 2020 Author Share Posted January 9, 2020 Thanks to @mikell solution ,I manage to extract the number. Local $sText = "bbbbbbbb 6666-666666-666, bbbbbbb bbbbb bbbbbb" & _ "bbb { ID: 6666-666-666, bbbbb } bbbbbb bbbbbbb" & _ "bbbbb { ID: 111-1111111-111111, bbbbbbbbb }bbbbbbb" & _ "bbbbbbbbbb bbb8888-8888-888bbb bbbbbbbbbbbb bbb" MsgBox(0, "", $sText) Local $teams = StringRegExp($sText, '(?s)ID:(.*?),', 3) For $i = 0 to UBound($teams)-1 MsgBox(0, "", $teams[$i]) Next pixelsearch 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now