John
Site Admin
Posts: 2597 Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH
Contact:
Post
by John » Mon Feb 07, 2011 9:56 am
That probably is the same HTML that both the browser and Vortex fetch, however the browser shows you the HTML after it has been updated with javascript, not what it actually received.
John Turnbull
Thunderstone Software
cpm18
Posts: 35 Joined: Mon Apr 13, 2009 3:21 pm
Post
by cpm18 » Mon Feb 07, 2011 10:39 am
Is it possible to get Vortex to process the javascript as the browser does?
I tried setting <urlcp javascript on> but that didn't seem to do it.
mark
Site Admin
Posts: 5515 Joined: Tue Apr 25, 2000 6:56 pm
Post
by mark » Mon Feb 07, 2011 3:53 pm
I don't know what the problem with the javascript is but you could extract the data by hand
<fetch ...>
<$html=$ret>
<$newhtml=$html>
<rex row 'id\="__w2_\P=[^_]+\F_datespan"' $html>
<$key=$ret>
<strfmt 'DateTimeComponent("%s", "", \\{"epoch_us": \\P=\\digit+\\F,' $key>
<rex $ret $html>
<if $ret ne ''>
<$when=(convert(convert($ret, 'double' )/1000000.0, 'dword' ))>
<$when=(convert($when, 'date' ))>
<strfmt '<span class\\="datetime" id\\="__w2_%s_datespan">Insert a dynamic date here</span>' $key>
<$s=$ret>
<strfmt '<span class="timestamp>%at</span>' '%I:%M%p %b %d' $when>
<$r=$ret>
<$newhtml=$ret>
</if>
</rex>
<!-- $newhtml has the HTML with date insertions -->
cpm18
Posts: 35 Joined: Mon Apr 13, 2009 3:21 pm
Post
by cpm18 » Mon Feb 07, 2011 5:27 pm
This worked fine. I think I was overthinking the best way to solve this.