Re: Browser HTML Source & URLs

2019-04-18 Thread hh via use-livecode
What you've seen is the difference of the htmltext of a browser
(also of a browser widget) and the *generated* htmltext.
The latter includes for example also parts that are generated by
JavaScript parts of the htmltext.

> BobS. wrote:
> I've seen that too. 
> 
> > Rick H. wrote:
> > I thought it was the source code originally too, 
> > but it doesn’t work correctly. 
> 
> hh wrote:
> put the htmltext of widget "browser" into field 1
> 
> If you don't mean the htmltext but the *generated* htmltext then you
> have to use JavaScript (see for example the firefox developer tools).

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Browser HTML Source & URLs

2019-04-18 Thread Bob Sneidar via use-livecode
I've seen that too. 

Bob S


> On Apr 17, 2019, at 11:22 , Rick Harrison via use-livecode 
>  wrote:
> 
> Thanks for getting back to me on this.
> 
>> The htmltext is the page source code. So
>> 
>> put the htmltext of widget "browser" into field 1
> 
> I thought it was the source code originally too,
> but it doesn’t work correctly.
> 
> For example:
> 
> set the HTMLText of field "HTMLTextField1" to URL field "WebAddressField1" of 
> this card
> (Where field "WebAddressField1" of this card = http://www.duckduckgo.com 
>  )
> 
> Look at the output in field HTMLTextField1.
> 
> Then go to the website with Safari with the Developer Menu turned on,
> and use the pull down menu option for “Show Page Source”.
> 
> You will see there is a vast difference between what Safari shows
> versus what LiveCode HTMLText shows.  (It’s less than useful!)
> 
> Your thoughts?
> 
> Thanks,
> 
> Rick

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Browser HTML Source & URLs

2019-04-17 Thread Richard Gaskin via use-livecode

Brian Milby wrote:

> Htmltext of a field is not the same as htmltext of the browser widget.

One of the best ideas Mark Waddingham ever had that he later abandoned 
was about ten years ago when he proposed adding "xmlText" as a synonym 
for "htmlText", flagging "htmlText" for eventual deprecation.


The best idea he never expressed having was calling the browser widget 
property "html" rather than "htmlText". Because that's what it is.


HTML is not htmlText.

Using that name for the field property hints at field capabilities that 
don't exist.


And then using that same name for the VERY different data in the browser 
object only makes a bad name worse.


I can understand why "htmlText" was used in the mid-90s when it was 
introduced, but it wasn't really a solid fit even then, and has become 
ever less like HTML every year since, causing ever more confusion.


#papercuts

--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Browser HTML Source & URLs

2019-04-17 Thread Rick Harrison via use-livecode
Hi Brian and Jacqueline,

Thank you for your helpful responses.

put url tURL into tSource

..was exactly what I needed!

Thanks again,

Rick

> On Apr 17, 2019, at 2:57 PM, J. Landman Gay via use-livecode 
>  wrote:
> 
>  put url tURL into tSource -- the source text

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Browser HTML Source & URLs

2019-04-17 Thread J. Landman Gay via use-livecode

Try this:

  put url tURL into tSource -- the source text
  set the htmlText of fld "HTMLText" to tSource -- LC's display

LC only supports a subset of HTML, so when you put the source into a 
field, only the supported parts go in. But you can grab the unadultered 
source first.


On 4/17/19 1:22 PM, Rick Harrison via use-livecode wrote:

Thanks for getting back to me on this.


The htmltext is the page source code. So

put the htmltext of widget "browser" into field 1


I thought it was the source code originally too,
but it doesn’t work correctly.

For example:

set the HTMLText of field "HTMLTextField1" to URL field "WebAddressField1" of 
this card
(Where field "WebAddressField1" of this card = http://www.duckduckgo.com 
 )

Look at the output in field HTMLTextField1.

Then go to the website with Safari with the Developer Menu turned on,
and use the pull down menu option for “Show Page Source”.

You will see there is a vast difference between what Safari shows
versus what LiveCode HTMLText shows.  (It’s less than useful!)

Your thoughts?

Thanks,

Rick




On Apr 17, 2019, at 6:13 AM, hh via use-livecode 
 wrote:


Rick H. wrote:
I am able to load the browser widget with a URL
and go to the URL successfully.

I can get the HTMLtext of the page I have browsed to just fine.
What I have yet to do is to get the page source code of the page
I have browsed to in LiveCode into a field.


The htmltext is the page source code. So

put the htmltext of widget "browser" into field 1

If you don't mean the htmltext but the *generated* htmltext then you
have to use JavaScript (see for example the firefox developer tools).


Rick H. wrote:
I also would like the browser widget to show me any new URL address
that I have gone to.


This stack shows also one way how to implement "history" for the widget
in a few lines:
http://forums.livecode.com/viewtopic.php?p=174936#p174936


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode




--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Browser HTML Source & URLs

2019-04-17 Thread Brian Milby via use-livecode
Htmltext of a field is not the same as htmltext of the browser widget.  A 
LiveCode field only supports a fraction of html.  In your example you need to 
just set the text of the field to see the page source.  Setting htmetext forces 
LiveCode to render the html and anything it does not understand is stripped.

Thanks,
Brian
On Apr 17, 2019, 2:23 PM -0400, Rick Harrison via use-livecode 
, wrote:
> Thanks for getting back to me on this.
>
> > The htmltext is the page source code. So
> >
> > put the htmltext of widget "browser" into field 1
>
> I thought it was the source code originally too,
> but it doesn’t work correctly.
>
> For example:
>
> set the HTMLText of field "HTMLTextField1" to URL field "WebAddressField1" of 
> this card
> (Where field "WebAddressField1" of this card = http://www.duckduckgo.com 
>  )
>
> Look at the output in field HTMLTextField1.
>
> Then go to the website with Safari with the Developer Menu turned on,
> and use the pull down menu option for “Show Page Source”.
>
> You will see there is a vast difference between what Safari shows
> versus what LiveCode HTMLText shows. (It’s less than useful!)
>
> Your thoughts?
>
> Thanks,
>
> Rick
>
>
>
> > On Apr 17, 2019, at 6:13 AM, hh via use-livecode 
> >  wrote:
> >
> > > Rick H. wrote:
> > > I am able to load the browser widget with a URL
> > > and go to the URL successfully.
> > >
> > > I can get the HTMLtext of the page I have browsed to just fine.
> > > What I have yet to do is to get the page source code of the page
> > > I have browsed to in LiveCode into a field.
> >
> > The htmltext is the page source code. So
> >
> > put the htmltext of widget "browser" into field 1
> >
> > If you don't mean the htmltext but the *generated* htmltext then you
> > have to use JavaScript (see for example the firefox developer tools).
> >
> > > Rick H. wrote:
> > > I also would like the browser widget to show me any new URL address
> > > that I have gone to.
> >
> > This stack shows also one way how to implement "history" for the widget
> > in a few lines:
> > http://forums.livecode.com/viewtopic.php?p=174936#p174936
> >
> >
> > ___
> > use-livecode mailing list
> > use-livecode@lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your 
> > subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Browser HTML Source & URLs

2019-04-17 Thread Rick Harrison via use-livecode
Thanks for getting back to me on this.

> The htmltext is the page source code. So
> 
> put the htmltext of widget "browser" into field 1

I thought it was the source code originally too,
but it doesn’t work correctly.

For example:

set the HTMLText of field "HTMLTextField1" to URL field "WebAddressField1" of 
this card
(Where field "WebAddressField1" of this card = http://www.duckduckgo.com 
 )

Look at the output in field HTMLTextField1.

Then go to the website with Safari with the Developer Menu turned on,
and use the pull down menu option for “Show Page Source”.

You will see there is a vast difference between what Safari shows
versus what LiveCode HTMLText shows.  (It’s less than useful!)

Your thoughts?

Thanks,

Rick



> On Apr 17, 2019, at 6:13 AM, hh via use-livecode 
>  wrote:
> 
>> Rick H. wrote:
>> I am able to load the browser widget with a URL
>> and go to the URL successfully.
>> 
>> I can get the HTMLtext of the page I have browsed to just fine.
>> What I have yet to do is to get the page source code of the page
>> I have browsed to in LiveCode into a field.
> 
> The htmltext is the page source code. So
> 
> put the htmltext of widget "browser" into field 1
> 
> If you don't mean the htmltext but the *generated* htmltext then you
> have to use JavaScript (see for example the firefox developer tools).
> 
>> Rick H. wrote:
>> I also would like the browser widget to show me any new URL address
>> that I have gone to.
> 
> This stack shows also one way how to implement "history" for the widget
> in a few lines:
> http://forums.livecode.com/viewtopic.php?p=174936#p174936
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Browser HTML Source & URLs

2019-04-17 Thread Håkan Liljegren via use-livecode
You can execute a small javascript to grab the HTML. I’ve done something 
similar in an Instagram Scraper I just built….

First you need to set up a callback function in the widget under javascript 
handlers e.g. jscallback then you can call a javascript that calls you back 
with whatever you want. Create field for the script, save script into a 
constant or just submit if it is short:

do ”liveCode.jscallback( ’source', document.documentElement.outerHTML );" in 
widget ”browser"

You also need to setup the jscallback in LiveCode:

on jscallback pMethod pValue
 if pMethod is ”source” then
      # pValue holds the source except the 
   end if
end jsCallback

Here I used a ”key value” principle with a method and a value, but you can of 
course set up several callbacks in the browser widget if you prefer.

Håkan
PS. Writing code directly in mail so it is untested and qoutes and formatting 
might be wrong...
On 16 Apr 2019, 16:53 +0200, Rick Harrison via use-livecode 
, wrote:
> I am able to load the browser widget with a URL
> and go to the URL successfully.
>
> I can get the HTMLtext of the page I have
> browsed to just fine.
>
> What I have yet to do is to get the page
> source code of the page I have browsed
> to in LiveCode into a field.
>
> I also would like the browser widget to
> show me any new URL address that I
> have gone to.
>
> Suggestions?
>
> Thanks,
>
> Rick
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Browser HTML Source & URLs

2019-04-17 Thread hh via use-livecode
> Rick H. wrote:
> I am able to load the browser widget with a URL
> and go to the URL successfully.
> 
> I can get the HTMLtext of the page I have browsed to just fine.
> What I have yet to do is to get the page source code of the page
> I have browsed to in LiveCode into a field.

The htmltext is the page source code. So

put the htmltext of widget "browser" into field 1

If you don't mean the htmltext but the *generated* htmltext then you
have to use JavaScript (see for example the firefox developer tools).

> Rick H. wrote:
> I also would like the browser widget to show me any new URL address
> that I have gone to.

This stack shows also one way how to implement "history" for the widget
in a few lines:
http://forums.livecode.com/viewtopic.php?p=174936#p174936


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode