Posts: 100
Threads: 45
Joined: Jan 2014
Hi Guys,
I need to edit a webpage's html. Is it possible without opening the element inspector?
Example:
How can change the title of Quick Macros webpage to "Quick Macros: The Best Solution"?
HtmlDoc d
d.InitFromWeb("http://www.quickmacros.com/")
int w=wait(3 WV win("Quick Macros" "IEFrame"))
Htm e=htm("TD" "QUICK MACROS" "" w "0" 0 0x21 3)
like:
e.Changetotext to ("Quick Macros: The Best Solution")
Posts: 1,337
Threads: 61
Joined: Jul 2006
10-24-2018, 01:50 PM
(This post was last modified: 10-24-2018, 02:11 PM by Kevin.)
this will change the active ie tab title
int w=win("" "IEFrame")
Htm e=htm("HTML" "" "" w "0")
str title TitleText
e.DocProp(0 0 title)
out title
e.el.document
TitleText="Quick Macros: The Best Solution"
MSHTML.IHTMLDocument2 doc=e.el.document
doc.title=TitleText
out "title changed"
e.DocProp(0 0 title)
out title
Posts: 100
Threads: 45
Joined: Jan 2014
Thanks, Kevin. But it didn't work. The webpage is still showing QUICK MACROS.
We need to change the html code from:
<table id="titlebar"><tbody><tr>
<td>QUICK MACROS</td>
To:
<table id="titlebar"><tbody><tr>
<td>Quick Macros: The Best Solution</td>
Posts: 1,337
Threads: 61
Joined: Jul 2006
10-24-2018, 04:45 PM
(This post was last modified: 10-24-2018, 04:51 PM by Kevin.)
not sure what part of the webpage your trying to change but here is a photo of the document title changed in the tab to what you wanted
oic you wanted the table element but you asked for the page title.
this is what you want changed?
int w=win("" "IEFrame")
Htm e=htm("TD" "QUICK MACROS" "" w "0" 0 0x1)
e.SetText("Quick Macros: The Best Solution")
Posts: 100
Threads: 45
Joined: Jan 2014
NICE! Thank you, Kevin! Sorry my mislead.