HTML Text retrieval

A

Atishoo

Am using Joels dump sub to retrieve location of text (a persons date of
birth) within a web page, all I get from the dump is:

HTML
HEAD
TITLE
FRAMESET
FRAME
FRAME
FRAME
I have tried returning Frame.item(0).innertext item1 item 2 etc but get no
innertext.
any ideas?
 
J

joel

Not all object have innertext. I suspect the FRAME is really anothe
webpage that the Java code is download and displaying. I would loolk a
the source code and see if there is a href property associate with th
object. You can add the href into the dump and put the data in
different column. Without seeing the webpage I can't tell what i
happening. If you are using IEversion 7 or 8 you can look at th
developers tool (F12) or look at the source code to get a clue (men
view - source).

I have had to open a second IE explorer and go tthe webpage that wa
referenced by the href to get the data in a 2nd frame
 
A

Atishoo

not much in the way of source code:
<frameset rows="175,30,*" frameborder="NO" border="0" framespacing="0"
cols="*">

<frame name="fraSUTop" scrolling="NO"
src="SU_top.asp?patient=890634&iSpell=&uStatus=active&mode=active&Timeline="
<frame name="fraSUMiddle" scrolling="NO"
src="SU_middle.asp?patient=890634&iSpell=&uStatus=active&mode=active&form=&letter=" >
<frame name="fraSUBottom"
src="SU_bottom.asp?mds=&np=&patient=890634&iSpell=&uStatus=active&mode=active&form=&formid=&id=&letter=" >
</frameset>
<noframes>


</noframes>
</html>
any ideas?

joel said:
Not all object have innertext. I suspect the FRAME is really another
webpage that the Java code is download and displaying. I would loolk at
the source code and see if there is a href property associate with the
object. You can add the href into the dump and put the data in a
different column. Without seeing the webpage I can't tell what is
happening. If you are using IEversion 7 or 8 you can look at the
developers tool (F12) or look at the source code to get a clue (menu
view - source).

I have had to open a second IE explorer and go tthe webpage that was
referenced by the href to get the data in a 2nd frame.


--
joel
------------------------------------------------------------------------
joel's Profile: 229
View this thread: http://www.thecodecage.com/forumz/showthread.php?t=161953

Microsoft Office Help

.
 
J

joel

The frames are just spliting the IE window frame into 3 pieces and i
not the object that contains the text. I would open the webpage withou
the VBA code by typing the URL into an explorer address box. the go t
the developers tool by type F12. there is a search box in the uppe
right corner of the developers tool. Type a string from the portio
webpage that you are looking for into the seatch box. The develope
tool should find where in the webpage the string is located. For som
reason the Search doesn't work when excel is connected to the webpage.
Not sure why

You can also do the same thing using the view - source menu (bu
sometimes you can't find it in the source).


Once you find the string then look for a tag (in angle brackect lik
<abc> or an ID="abc". Look for the tag or the ID before the string yo
are looking for.

You can get the ID object using this. the ID in the source code i
returned from the below statement. You could have the same id occo
multiple times and set varialbe would be an aray.

Set abc = IE.document.getelementbyid("abc")


You can get the tag like this

You can get the tag object using this. The tag in the source code i
returned from the below statement. You could have the same id occo
multiple times and set varialbe would be an aray.

Set abc = IE.document.getelementsbytagname("abc")


Some times the object is a child of the object you are looking for.
often put the SEt variable in a watch window in VBA by hightlighting th
variable (like abc) in the VBA window. then right click the highlighte
variable and select Watch. Press OK in the pop up window. then you ca
press the plus sign in the watch window to see all the properties. I
you don't find the text in the innertext property look for an item an
the end of the properties or lokk at the childnoes. If the object is
table then look under the property rows and to get the columns unde
rows look for cells.


I found case like I mentioned before that the data came from anothe
webpage under the href property. Text cna be found in one of
properties

innertext
innerhtml
outertext
outerhtml.

The case where it came from another webpage the text was put into th
innerhtml property. Instead of pasing the string from the innerhtml i
was easier to go to the 2nd webpage to get the data.

In your case there is an application running which is putting the dat
into the frames. The data is coming from the SU_top.asp, SU_middle.asp
and SU_bottom.asp. You data is propably in the Frame as either th
innerhtml or outerhtml and may not be easily extracted. It would b
better to get a different object which contains the text
 
T

Tim Williams

To reach an element in a frame:

document.frames("fraSUMiddle").document.getelementbyid("blah")

Tim


Atishoo said:
not much in the way of source code:
<frameset rows="175,30,*" frameborder="NO" border="0" framespacing="0"
cols="*">

<frame name="fraSUTop" scrolling="NO"
src="SU_top.asp?patient=890634&iSpell=&uStatus=active&mode=active&Timeline="
<frame name="fraSUMiddle" scrolling="NO"
src="SU_middle.asp?patient=890634&iSpell=&uStatus=active&mode=active&form=&letter="<frame name="fraSUBottom"
src="SU_bottom.asp?mds=&np=&patient=890634&iSpell=&uStatus=active&mode=active&form=&formid=&id=&letter="</frameset>
<noframes>


</noframes>
</html>
any ideas?

joel said:
Not all object have innertext. I suspect the FRAME is really another
webpage that the Java code is download and displaying. I would loolk at
the source code and see if there is a href property associate with the
object. You can add the href into the dump and put the data in a
different column. Without seeing the webpage I can't tell what is
happening. If you are using IEversion 7 or 8 you can look at the
developers tool (F12) or look at the source code to get a clue (menu
view - source).

I have had to open a second IE explorer and go tthe webpage that was
referenced by the href to get the data in a 2nd frame.


--
joel
------------------------------------------------------------------------
joel's Profile: 229
View this thread:
http://www.thecodecage.com/forumz/showthread.php?t=161953

Microsoft Office Help

.
 
J

joel

Tim: Don't you need the IE object?


IE.document.frames("fraSUMiddle").document.getelementbyid("blah")


Atishoo still needs to find the object.

I would put the outertext.html in to a cell like this

Range("A1") = IE.document.frames("fraSUMiddle").innerhtml

or

Range("A1") = IE.document.frames("fraSUMiddle").outerhtml



Then copy the cell into Notepad and look at the data to find either a
TAG or ID associated with data Atishoo is looking for.
 
J

joel

You have to be aware of the person skill level in answering questions.
I've learned from experience with these posting assume nothing unles
you dealt with a person before when answering a question. Answering
question without enough info leads to a lot of responses
 
J

joel

Yeh! The fine line is being successful and catching the fish. I hav
spent plenty of days watching the guy next to me catching and me no
catching, and then being the guy who caught the fish with everybody els
watching. sometimes it just luck but you want to always do everythin
you can to improve the odds.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top