AntecK7 All American 7755 Posts user info edit post |
I work in support, and we have a web based support system, remedy.
When a ticket comes in, the system displays a username and email address, and whatever the problem is.
I want to make a application that runs seperatly from the remedy IE client, and looks for email addresses in the displayed page.
If it finds an email address with @user.domain, it will automatically query AD and bring up the information.
After that i plan on resolving them to AD and doing some other lookups, the hope is to help our Tier 1 staff identify simple problems (Locked account/expired password)
Any ideas how to pull that data from IE? I have some code that works for notepad, but not much else.
screenshot of remedy app
[Edited on August 2, 2012 at 2:28 PM. Reason : dd] 8/2/2012 2:17:16 PM |
Noen All American 31346 Posts user info edit post |
http://www.excelforum.com/excel-programming-vba-macros/668702-html-scraping-using-vba.html
or
http://sourceforge.net/projects/libcurl-vb/ 8/2/2012 3:50:45 PM |
AntecK7 All American 7755 Posts user info edit post |
I'm not really trying to massies of sites, and the content I want, isn't in the HTML...at least to my knowledge.
Right now i have a webbrowser control, it loads the page, and i can use the documenttext and documentstream to read the html, but, that dosnt actually give me the information off the page, but teh stuff used to render it.
If i do a manual control A and control P to notepad i get the text i want to reference.
I'm okay loading the application in a webbrowser control, and triggering it on a page load finish. 8/2/2012 4:30:28 PM |
Noen All American 31346 Posts user info edit post |
^From the looks of your screenshot, that's because it looks like your web app uses iframes.
So you're going to have to do a recursive crawl:
CURL the document for iframes CURL the iframes for the internal body
Parse the iframe bodies that have your information in them. 8/2/2012 5:15:26 PM |
BigMan157 no u 103354 Posts user info edit post |
it's might be generating some of the info with JS too 8/2/2012 5:21:12 PM |
AntecK7 All American 7755 Posts user info edit post |
I think part of my problem is that I dont understand how websites are actually but with dynamic content.
I'll try to play with the curl stuff next week as i get time. Right now i found a kinda hacky way to do it by doing a copy to clipboard of the page and then reading that in, but its sin ugly. 8/3/2012 10:07:38 AM |
Kris All American 36908 Posts user info edit post |
Have you ever used Selenium? It's a great tool that can be used for making macros for web applications, and it keeps you from really having to parse HTML and reverse engineering the page. 8/3/2012 12:27:08 PM |
AntecK7 All American 7755 Posts user info edit post |
okay
I got it figured out, but now I'm having a problem with popups.
I think i need to clarify what I plan to do with this in order to answer some of the questions and commnets.
1. I suck at programming, my only vb.net application so far is something that setup backup servers and was basically a GUI for USMT4.
2. I don't know anything about web pages, but I know about text parsing.
3. Currently I have the webapplication remedy running as a webbrowser control.
I figured out that I can read the text off the page by creating an IHTMLDocument2=webbrowser1.document This works great, as My page has a fixed text item of the selected entry in the form of "Customer:Username Notes:"
So when a user selects a name, i trigger off the click and find out who the customer is.
This all works great, it ties into active directory and pulls the users data (Password last set, is the account locked out, ect ect).
This is a big help to the helpdesk/CS staff as they don't have to have 2 windows open to query on a user, and most of the time their AD contact info is also more accurate.
Now the webapp opens a few popups that unfortunately need to be seen, and also need to be in the same browser session.
I'm trying to implement the solution referenced here http://www.vbforums.com/archive/index.php/t-675479.html, and i have a new project created.
Here is my code
Imports SHDocVw
Public Class Form1
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load WebBrowser1.Navigate("mysite") Dim activeXBrowser As SHDocVw.WebBrowser = CType(WebBrowser1.ActiveXInstance, SHDocVw.WebBrowser) AddHandler activeXBrowser.NewWindow3, AddressOf axBrowserNewWindow3 End Sub
Private Sub axBrowserNewWindow3(ByRef ppDisp As Object, ByRef cancel As Boolean, dwflags As UInteger, bstrUrlContent As String, bstrUrl As String) Dim frm As New Form1 frm.Show() frm.WebBrowser1.Navigate(bstrUrl) cancel = True End Sub
Private Sub WebBrowser1_NewWindow(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles WebBrowser1.NewWindow e.Cancel = True End Sub End Class
I get no popups, and it does not look like the axBrowserNewWindow3 event is ever triggered 8/6/2012 8:24:54 PM |
lewisje All American 9196 Posts user info edit post |
use gecko
problem solved 8/6/2012 8:40:43 PM |
AntecK7 All American 7755 Posts user info edit post |
I think they would string me up if i used firefox.
Private Sub AxWebBrowser1_NewWindow3(sender As Object, e As AxSHDocVw.DWebBrowserEvents2_NewWindow3Event) Handles AxWebBrowser1.NewWindow3
'Method 1
processed()
Dim Ax2 As New AxSHDocVw.AxWebBrowser
Dim f As New Form
f.Controls.Add(Ax2)
f.Show()
e.ppDisp = Ax2.Application
works, however when popups close, they don't return control to the main form properly. The only buttons that work on it are the ones that create popups. None of the java buttons work anymore. 8/7/2012 8:11:06 PM |
lewisje All American 9196 Posts user info edit post |
use javascript f00 8/8/2012 12:35:45 AM |
AntecK7 All American 7755 Posts user info edit post |
you might as well be saying use the turboencabulator.
Give me some context. 8/9/2012 1:25:18 PM |
lewisje All American 9196 Posts user info edit post |
you say "none of the java buttons work anymore"
now why would you use java applets in this day and age (unless it were some high-computation application, like the falling-sand game, or some graphing demo)
anyway have you considered basing it all on webkit, if gecko is a no-go 8/9/2012 4:37:28 PM |
Noen All American 31346 Posts user info edit post |
This is one of MANY reasons that Remedy and BMC blow ass.
They have Java and C++ api's but no REST APIs for web service integration.
You might be able to load their C++ SDK into your VB.net app and leverage their API that way. It will be a LOT faster and more reliable than doing web scraping (and given that they use Java applets for shit, web scraping is not going to work).
Or you could get your management to actually look at other Service management (and IT management) systems that don't blow. System Center 2012 has full REST API web services and ODATA connections through SPF. To my knowledge so does VMWare's vSphere AND IBM's Tivoli AND Oracle's suite AND CA's too.
So basically, either write your application in Java or C++, try to use the C++ SDK in your VB app, or move to a better ITSM solution 8/10/2012 12:34:40 AM |