Source language: Translate to:

Webobject issue

General questions about NeoBook

Moderator: Neosoft Support

Webobject issue

Postby shx » Wed May 21, 2014 6:57 pm

I'm having a problem with the WebObject.

It seems that the variable that stores the current url (webbrowser1addr) , many times is get the value of "javascript:false" instead of the actual url.

For example, if the URL to browse to is"www.lenovo.com" , instead of containing this web address the variable webbrowser1addr will contain "javascript:false"


I'm pretty sure that it didn't always work like this. in the past I would get a proper URL in the variable.
- Steven
User avatar
shx
 
Posts: 167
Joined: Sun Apr 03, 2005 5:49 am

Re: Webobject issue

Postby dpayer » Thu May 22, 2014 7:36 am

shx wrote:I'm having a problem with the WebObject.

It seems that the variable that stores the current url (webbrowser1addr) , many times is get the value of "javascript:false" instead of the actual url.

For example, if the URL to browse to is"www.lenovo.com" , instead of containing this web address the variable webbrowser1addr will contain "javascript:false"


I'm pretty sure that it didn't always work like this. in the past I would get a proper URL in the variable.


The address can be rewritten by javascript and this will not change what is seen in the address bar which I think is what the [webbrowser1addr] variable displays. For example, go into Google+ and navigate your account if you have one. You will see that the address never changes in the address bar. Navigation is all handled via scripting. It is possible that http://www.lenovo.com had done the same. After all, here are all the javascripts it loads on that index.html page before the content is rendered:
Code: Select all
<script src="//shop.lenovo.com/ISS_Static/WW/omniture/s_code_lisa.js"></script>
<script src="//shop.lenovo.com/ISS_Static/WW/omniture/mbox.js"></script>
<script src="//lenovo.demdex.net/event?d_stuff=1&d_dst=1&d_rtbd=json&d_cts=1&d_cb=aam_tnt_cb"></script>
<script src="//admin.brightcove.com/js/BrightcoveExperiences.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/jquery-ui.min.js"></script>
<script src="//shop.lenovo.com/ISS_Static/WW/site/scripts/modernizr.js"></script>
<script src="//shop.lenovo.com/ISS_Static/WW/site/scripts/swfobject.js"></script>
<script src="//shop.lenovo.com/ISS_Static/WW/site/scripts/jquery/jquery.tools.min.js"></script>
<script src="//shop.lenovo.com/ISS_Static/WW/site/scripts/jquery/jquery.hoverIntent.min.js"></script>
<script src="//shop.lenovo.com/ISS_Static/WW/site/scripts/jquery/jquery.embedBrightcove.js"></script>
<script src="//shop.lenovo.com/ISS_Static/WW/site/scripts/jquery/jquery.cookie.js"></script>
<script src="//shop.lenovo.com/ISS_Static/WW/site/scripts/jquery/jquery.dump.js"></script>
<script src="//shop.lenovo.com/ISS_Static/WW/site/scripts/jquery/bjqs.min.js"></script>
<script src="//shop.lenovo.com/ISS_Static/WW/site/scripts/jquery/jquery.lazyload.js"></script>
<script src="//shop.lenovo.com/ISS_Static/WW/site/scripts/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
<script src="//shop.lenovo.com/ISS_Static/WW/site/scripts/ow/common.js"></script>
<script src="//shop.lenovo.com/ISS_Static/WW/site/scripts/ow/crossbrandcompare.js"></script>
<script src="//shop.lenovo.com/SEUILibrary/hightech-portal/js/commonScripts/NavTop.js"></script>
<!--[if lt IE 9]>
<script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

<script type="text/javascript" src="//shop.lenovo.com/ISS_Static/WW/site/masthead/ow/masthead.js"></script>
<script type="text/javascript">
   $(function() {
      if (!Modernizr.input.placeholder) {
         $('input[type=email]').each(function() {
            if ($(this).val()=='' && $(this).attr('placeholder')!='') {
               $(this).val($(this).attr('placeholder'));
               $(this).focus(function() {
                  if ($(this).val()==$(this).attr('placeholder')) $(this).val('');
               });
               $(this).blur(function() {
                  if ($(this).val()=='') $(this).val($(this).attr('placeholder'));
               });
            }
         });
      }
      $('#email_signup').validator({messageClass:'validation-error', offset:[-3, 0], position:'top center'});
   });
</script>
               <!--Demandbase API reference tag-->
               <script type="text/javascript">
                  //Function to Parse for Demandbase Data
                  var demandbase_parse = function(company) {
                     db_company = {};
                     if(company) window.db_company = company;
                  }
               </script>
               <script type="text/javascript" src="//api.demandbase.com/api/v2/ip.json?key=100fc98f9f3d4e15eaccfeabc13fc29a872450a9&callback=demandbase_parse"></script>
               <script type="text/javascript" src="//dkj2m377b0yzw.cloudfront.net/clients/javascript/demandbase-1.0.0-min.js"></script>
               <script type="text/javascript" src="//api.demandbase.com/api/v2/ip.json?key=efd965c95fed419582f21eb7d705edf5fe46c016&callback=set_mbox_variables"></script>
               <!--END Demandbase API reference tag-->
               <style type="text/css"><!--a.button.xl {
               height:35px !important;;
               
               }
            .hp-box {
               right:30px !important;
               
               }
            #homepage .e-spots {
               width:300px !important;
               
               }
            #bodywrap #bodywrapinner #bodycontent {
               min-height:500px !important;
               
               }
            #masthead_upper > div #menus #navigation > li#pcfinder {
               display:none;
               
               }
            #ribbon {
               display:none;
               
               }
            --></style><script type="text/javascript" src="//s3.amazonaws.com/madmobile/lenovo/mobiledirect.js"><!----></script><script type="text/javascript" src="/la/js/OneWeb/footer_fix.min.js"><!----></script><script type="text/javascript" src="//adadvisor.net/adscores/g.js?sid=9201881618"><!----></script><script type="text/javascript">
$(window).load(function() {
$(window).scroll();
});

//IE issue on seperator link
$(function() {
  $("#ribbon").on("click", function(e) {
    var mouseX = e.pageX,
      mouseY = e.pageY;
    $(".hp-separator").each(function() {
      var $this = $(this),
        offset = $this.offset(),
        width = $this.width(),
        height = $this.height();
      if ((mouseX > offset.left) && (mouseX < (offset.left+width)) && (mouseY > offset.top) && (mouseY < (offset.top+height))) {
        var href = $this.find("a[href!='']").filter(function() { return !$(this).hasClass("backtotop") }).attr("href");
        window.location.href = href;
      }
    });
  });
});
</script></head><body><script type="text/javascript">
            var utag_data = {
               country_code : "US",
               language_code : "en",
               site_id : "web",
               page_type : "HomePage",
               site_flow : "corporate",
               sub_page_type : "HomePage"
            }
            </script><style type="text/css">
#masthead_upper > div #toolmenus #utility{left:-230px !important; top:-2px;}
#masthead_upper > div #toolmenus #search {top:27px;}
#masthead_upper > div #toolmenus #tagline {position:relative; left:235px;}
#masthead_upper > div #toolmenus #search form {border:2px solid #009dd9 !important;}
#masthead_upper > div #menus #navigation > li:last-child, #masthead_upper > div #menus #navigation > li#pcfinder > a {display:none;}
#masthead_upper > div #menus #navigation > li{padding-right:2px; padding-left:2px;}
#masthead_upper > div #toolmenus #search form label {display:none !important;}
#masthead_upper > div #toolmenus #search form button.submit_site_search {
display:block !important;
background:#f8f8f8 url("//shop.lenovo.com/ISS_Static/WW/site/masthead/ow/images/search_icon_15x15.png") no-repeat center center !important;
                height: 20px;
      overflow: hidden;
      text-indent: -9999em;
      width: 25px;
      position: relative;
      border:none !important;
      float: right;
      margin-top: -20px;
      -webkit-box-shadow: rgba(0, 0, 0, 0.5) 2px 2px 5px inset;
      -moz-box-shadow: rgba(0, 0, 0, 0.5) 2px 2px 5px inset;
      box-shadow: rgba(0, 0, 0, 0.5) 2px 2px 5px inset;
      }
#masthead_upper > div #toolmenus #search form input {padding:0 7px !important;}
</style>

<script>
$(document).ready(function(){
   $('#navigation li#pcfinder').addClass('last');
   $('#navigation li#deals').removeClass('last');
   $('#navigation li#pcfinder>a').removeClass('button shop fluid');
   $('#menus > #navigation > li').eq(8).attr("id","pcFinder");
   $('#navigation > li:last-child').show();
   $('#navigation li#pcFinder > a').show();
});
</script>



David P.
David Payer
Des Moines, Iowa
USA
User avatar
dpayer
 
Posts: 1380
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Re: Webobject issue

Postby shx » Thu May 22, 2014 1:15 pm

Hello David,

the problem is that [webbrowser1addr] is not displaying the url that you see in a web browser.

Also, I just used the Lenovo site as an example, but it is happening all over.


what I am looking for is that [webbrowser1addr] should contain what is in the address bar of the browser.
- Steven
User avatar
shx
 
Posts: 167
Joined: Sun Apr 03, 2005 5:49 am

Re: Webobject issue

Postby Gaev » Thu May 22, 2014 3:31 pm

Steven:

When an AJAX (Asynchronous Javascript and XML) type of call is made from a web page, the content of the Address Box in the Browser is NOT updated ... looks like [WebbrowserXAddr] is updated with every such call ... as shown by a little test I did to log the WebbrowserXAddr and WebbrowserXStatus variables in each of the Actions facilitated by the Webbrowser object ...
Before Navigate: Addr=http://www.lenovo.com/ Status=

Download Begin: Addr=http://www.lenovo.com/ Status=

Download Complete: Addr=http://www.lenovo.com/ Status=

Download Begin: Addr=http://www.lenovo.com/ Status=

Before Navigate: Addr=javascript:false Status=Waiting for http://www.lenovo.com/ca/en/...

Download Complete: Addr=javascript:false Status=(10 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Download Begin: Addr=javascript:false Status=(10 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Download Complete: Addr=javascript:false Status=(10 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Download Begin: Addr=javascript:false Status=(10 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Download Complete: Addr=javascript:false Status=(10 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Download Begin: Addr=javascript:false Status=(10 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Download Complete: Addr=javascript:false Status=(10 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Download Begin: Addr=javascript:false Status=(10 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Download Complete: Addr=javascript:false Status=(10 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Download Begin: Addr=javascript:false Status=(10 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Download Complete: Addr=javascript:false Status=(10 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Download Begin: Addr=javascript:false Status=(10 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Download Complete: Addr=javascript:false Status=(10 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Download Begin: Addr=javascript:false Status=(10 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Download Complete: Addr=javascript:false Status=(10 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Download Begin: Addr=javascript:false Status=(10 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Download Complete: Addr=javascript:false Status=(8 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Download Begin: Addr=javascript:false Status=(8 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Download Complete: Addr=javascript:false Status=(8 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Before Navigate: Addr=http://dis.ny.us.criteo.com/dis/dis.aspx?p=3087&cb=86516145999&ref=&sc_r=1152x864&sc_d=32&site_type=d Status=(1 item remaining) Downloading picture https://lenovopsp.px.247-inc.com/spacer.gif...

Download Begin: Addr=http://dis.ny.us.criteo.com/dis/dis.aspx?p=3087&cb=86516145999&ref=&sc_r=1152x864&sc_d=32&site_type=d Status=(1 item remaining) Downloading picture https://lenovopsp.px.247-inc.com/spacer.gif...

Download Complete: Addr=http://www.lenovo.com/ca/en/ Status=Done

Navigate Complete: Addr=http://www.lenovo.com/ca/en/ Status=Done

Since I am based in Canada, the address bar (in Firefox) ended up displaying http://www.lenovo.com/ca/en/ ... which is the value of the WebbrowserXAddr variable when Navigate Complete is triggered and Status=Done ...
Navigate Complete: Addr=http://www.lenovo.com/ca/en/ Status=Done
So you might try and grab the Address value in this Event section AND Status=Done


f.y.i. Regarding AJAX, note that ...

1) Asynchronous calls from web pages are now very common ... as it is the means by which partial content of a page is changed without having to reload a new page ... by using them in the "page load" stage, it gives the appearance of a fast responding website (user can start reading text while images and other large secondary components are still being fetched)

2) the XML is just a historical reference (before JSON was invented and became hugely popular)
User avatar
Gaev
 
Posts: 3716
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: Webobject issue

Postby fkapnist » Tue Nov 18, 2014 5:06 pm

I had the same thing... WebBrowser1 is my main browser area and TextEntry1 is the Address Bar (simple text field)... then I added the following code to the Actions > Navigate Complete > tab of my WebBrowser1 object.....

Syntax: [ Download ] [ Hide ]
Using Neobook Syntax Highlighting
SetVar "[ParentAddress]" "[WebBrowser1Addr]"
.AlertBox "web" "[WebBrowser1Addr]"
.AlertBox "page" "[ParentAddress]"
SetVar "[TextEntry1]" "[ParentAddress]"
Parsed in 0.006 seconds, using GeSHi 1.0.8.10


The idea is to grab the top or parent URL of the page you're on, not the Javascripts and about:blank statements embedded within it. And this gets rid of almost all of the advert locations.... Also now if you click on a link the address bar will show the new URL when the page loads..... Enable the alert boxes to debug and show you the difference between a WebBrowser1 address (the last item loaded) and the first item caught in the new ParentAddress variable....
User avatar
fkapnist
 
Posts: 348
Joined: Mon Nov 17, 2014 4:24 pm
Location: Greece

Re: Webobject issue

Postby fkapnist » Sat Nov 22, 2014 2:07 am

Gaev wrote:Steven:

When an AJAX (Asynchronous Javascript and XML) type of call is made from a web page, the content of the Address Box in the Browser is NOT updated ... looks like [WebbrowserXAddr] is updated with every such call ... as shown by a little test I did to log the WebbrowserXAddr and WebbrowserXStatus variables in each of the Actions facilitated by the Webbrowser object ...
Before Navigate: Addr=http://www.lenovo.com/ Status=

Download Begin: Addr=http://www.lenovo.com/ Status=

Download Complete: Addr=http://www.lenovo.com/ Status=

Download Begin: Addr=http://www.lenovo.com/ Status=

Before Navigate: Addr=javascript:false Status=Waiting for http://www.lenovo.com/ca/en/...

Download Complete: Addr=javascript:false Status=(10 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Download Begin: Addr=javascript:false Status=(10 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Download Complete: Addr=javascript:false Status=(10 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Download Begin: Addr=javascript:false Status=(10 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Download Complete: Addr=javascript:false Status=(10 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Download Begin: Addr=javascript:false Status=(10 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Download Complete: Addr=javascript:false Status=(10 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Download Begin: Addr=javascript:false Status=(10 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Download Complete: Addr=javascript:false Status=(10 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Download Begin: Addr=javascript:false Status=(10 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Download Complete: Addr=javascript:false Status=(10 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Download Begin: Addr=javascript:false Status=(10 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Download Complete: Addr=javascript:false Status=(10 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Download Begin: Addr=javascript:false Status=(10 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Download Complete: Addr=javascript:false Status=(10 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Download Begin: Addr=javascript:false Status=(10 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Download Complete: Addr=javascript:false Status=(8 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Download Begin: Addr=javascript:false Status=(8 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Download Complete: Addr=javascript:false Status=(8 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Before Navigate: Addr=http://dis.ny.us.criteo.com/dis/dis.aspx?p=3087&cb=86516145999&ref=&sc_r=1152x864&sc_d=32&site_type=d Status=(1 item remaining) Downloading picture https://lenovopsp.px.247-inc.com/spacer.gif...

Download Begin: Addr=http://dis.ny.us.criteo.com/dis/dis.aspx?p=3087&cb=86516145999&ref=&sc_r=1152x864&sc_d=32&site_type=d Status=(1 item remaining) Downloading picture https://lenovopsp.px.247-inc.com/spacer.gif...

Download Complete: Addr=http://www.lenovo.com/ca/en/ Status=Done

Navigate Complete: Addr=http://www.lenovo.com/ca/en/ Status=Done

Since I am based in Canada, the address bar (in Firefox) ended up displaying http://www.lenovo.com/ca/en/ ... which is the value of the WebbrowserXAddr variable when Navigate Complete is triggered and Status=Done ...
Navigate Complete: Addr=http://www.lenovo.com/ca/en/ Status=Done
So you might try and grab the Address value in this Event section AND Status=Done


f.y.i. Regarding AJAX, note that ...

1) Asynchronous calls from web pages are now very common ... as it is the means by which partial content of a page is changed without having to reload a new page ... by using them in the "page load" stage, it gives the appearance of a fast responding website (user can start reading text while images and other large secondary components are still being fetched)

2) the XML is just a historical reference (before JSON was invented and became hugely popular)


In which part of the neobook script is the "Status=Done" value inserted? I tried this but saw no difference:
Syntax: [ Download ] [ Hide ]
Using Neobook Syntax Highlighting
SetVar "[TextEntry1]" "[WebBrowser1Addr] Status=Done"
Parsed in 0.005 seconds, using GeSHi 1.0.8.10
User avatar
fkapnist
 
Posts: 348
Joined: Mon Nov 17, 2014 4:24 pm
Location: Greece

Re: Webobject issue

Postby fkapnist » Sat Nov 22, 2014 2:53 am

fkapnist wrote:
Gaev wrote:Steven:

When an AJAX (Asynchronous Javascript and XML) type of call is made from a web page, the content of the Address Box in the Browser is NOT updated ... looks like [WebbrowserXAddr] is updated with every such call ... as shown by a little test I did to log the WebbrowserXAddr and WebbrowserXStatus variables in each of the Actions facilitated by the Webbrowser object ...
Before Navigate: Addr=http://www.lenovo.com/ Status=

Download Begin: Addr=http://www.lenovo.com/ Status=

Download Complete: Addr=http://www.lenovo.com/ Status=

Download Begin: Addr=http://www.lenovo.com/ Status=

Before Navigate: Addr=javascript:false Status=Waiting for http://www.lenovo.com/ca/en/...

Download Complete: Addr=javascript:false Status=(10 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Download Begin: Addr=javascript:false Status=(10 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Download Complete: Addr=javascript:false Status=(10 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Download Begin: Addr=javascript:false Status=(10 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Download Complete: Addr=javascript:false Status=(10 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Download Begin: Addr=javascript:false Status=(10 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Download Complete: Addr=javascript:false Status=(10 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Download Begin: Addr=javascript:false Status=(10 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Download Complete: Addr=javascript:false Status=(10 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Download Begin: Addr=javascript:false Status=(10 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Download Complete: Addr=javascript:false Status=(10 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Download Begin: Addr=javascript:false Status=(10 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Download Complete: Addr=javascript:false Status=(10 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Download Begin: Addr=javascript:false Status=(10 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Download Complete: Addr=javascript:false Status=(10 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Download Begin: Addr=javascript:false Status=(10 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Download Complete: Addr=javascript:false Status=(8 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Download Begin: Addr=javascript:false Status=(8 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Download Complete: Addr=javascript:false Status=(8 items remaining) Downloading picture http://privacy-policy.truste.com/privac ... 7406ac64...

Before Navigate: Addr=http://dis.ny.us.criteo.com/dis/dis.aspx?p=3087&cb=86516145999&ref=&sc_r=1152x864&sc_d=32&site_type=d Status=(1 item remaining) Downloading picture https://lenovopsp.px.247-inc.com/spacer.gif...

Download Begin: Addr=http://dis.ny.us.criteo.com/dis/dis.aspx?p=3087&cb=86516145999&ref=&sc_r=1152x864&sc_d=32&site_type=d Status=(1 item remaining) Downloading picture https://lenovopsp.px.247-inc.com/spacer.gif...

Download Complete: Addr=http://www.lenovo.com/ca/en/ Status=Done

Navigate Complete: Addr=http://www.lenovo.com/ca/en/ Status=Done

Since I am based in Canada, the address bar (in Firefox) ended up displaying http://www.lenovo.com/ca/en/ ... which is the value of the WebbrowserXAddr variable when Navigate Complete is triggered and Status=Done ...
Navigate Complete: Addr=http://www.lenovo.com/ca/en/ Status=Done
So you might try and grab the Address value in this Event section AND Status=Done


f.y.i. Regarding AJAX, note that ...

1) Asynchronous calls from web pages are now very common ... as it is the means by which partial content of a page is changed without having to reload a new page ... by using them in the "page load" stage, it gives the appearance of a fast responding website (user can start reading text while images and other large secondary components are still being fetched)

2) the XML is just a historical reference (before JSON was invented and became hugely popular)


In which part of the neobook script is the "Status=Done" value inserted? I tried this but saw no difference:
Syntax: [ Download ] [ Hide ]
Using Neobook Syntax Highlighting
SetVar "[TextEntry1]" "[WebBrowser1Addr] Status=Done"
Parsed in 0.004 seconds, using GeSHi 1.0.8.10



No doubt, the "Status=Done" value plays a very important role in fetching the address. After experimenting, I found this to work best for me in the Navigate Complete tab:
Syntax: [ Download ] [ Hide ]
Using Neobook Syntax Highlighting
SetVar "[ParentAddress2]" "[WebBrowser1Addr] Status=Done"
StrReplace "[ParentAddress2]" "Status=Done" " " "[ParentAddress]" ""
SetVar "[TextEntry1]" "[ParentAddress]" Status=Done
Parsed in 0.005 seconds, using GeSHi 1.0.8.10

It filters out all the tag debris (also removing the final Status=Done comment) and leaves only the real address of the page you are on. :mrgreen:

:P
User avatar
fkapnist
 
Posts: 348
Joined: Mon Nov 17, 2014 4:24 pm
Location: Greece

Re: Webobject issue

Postby Gaev » Sat Nov 22, 2014 8:18 am

fkapnist:

In which part of the neobook script is the "Status=Done" value inserted?

When you create a Web Browser tool/object, you can specify several associated variables ... one of them is called Variable to store brower's status text, its default value is [WebBrowserXStatus] ... where X is "1" for WebBrowser1, "2" for WebBrowser2 etc.

So, in your event sections for the Browser Object ...

Before Navigate
Download Begin
Download Complete
Navigate Complete

... you can enquire/capture the value of this variable ... and store it somewhere else (since it will keep changing as events unfold).

The contents in my previous post shows the values that I captured from each of the event sections ... and logged to a file ... to learn about the happenings when you make a request for that URL.
User avatar
Gaev
 
Posts: 3716
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: Webobject issue

Postby fkapnist » Sat Nov 22, 2014 8:38 am

Gaev wrote:fkapnist:

In which part of the neobook script is the "Status=Done" value inserted?

When you create a Web Browser tool/object, you can specify several associated variables ... one of them is called Variable to store brower's status text, its default value is [WebBrowserXStatus] ... where X is "1" for WebBrowser1, "2" for WebBrowser2 etc.

So, in your event sections for the Browser Object ...

Before Navigate
Download Begin
Download Complete
Navigate Complete

... you can enquire/capture the value of this variable ... and store it somewhere else (since it will keep changing as events unfold).

The contents in my previous post shows the values that I captured from each of the event sections ... and logged to a file ... to learn about the happenings when you make a request for that URL.


I know about the WebBrowserXStatus variable... the address of the page should be displayed in the top bar and it comes from the WebBrowserXAddr variable but it sometimes sends strings like "about:blank" to the top address bar. I think there are ways to filter out the results. I suppose you can get the page URL from either of the two variables, but which is better? :?:
User avatar
fkapnist
 
Posts: 348
Joined: Mon Nov 17, 2014 4:24 pm
Location: Greece

Re: Webobject issue

Postby Gaev » Sat Nov 22, 2014 10:11 am

I know about the WebBrowserXStatus variable... the address of the page should be displayed in the top bar and it comes from the WebBrowserXAddr variable but it sometimes sends strings like "about:blank" to the top address bar. I think there are ways to filter out the results. I suppose you can get the page URL from either of the two variables, but which is better?

If you look at the logged lines, the last line ... from the Navigate Complete section has the URL ... and note that the value of WebBrowser1Status at this time is "Done".

So try and check for this Status in this event section ... and if there is a match, copy the contents of [WebBrowser1Addr] to another variable ... then use this saved variable content to show the URL.
User avatar
Gaev
 
Posts: 3716
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: Webobject issue

Postby fkapnist » Sat Nov 22, 2014 10:51 am

Gaev wrote:
I know about the WebBrowserXStatus variable... the address of the page should be displayed in the top bar and it comes from the WebBrowserXAddr variable but it sometimes sends strings like "about:blank" to the top address bar. I think there are ways to filter out the results. I suppose you can get the page URL from either of the two variables, but which is better?

If you look at the logged lines, the last line ... from the Navigate Complete section has the URL ... and note that the value of WebBrowser1Status at this time is "Done".

So try and check for this Status in this event section ... and if there is a match, copy the contents of [WebBrowser1Addr] to another variable ... then used this saved variable content to show the URL.


I think I understand... when the status value is "done" copy the address to a variable and send it to the address bar....(using the WhileEx action)....

Syntax: [ Download ] [ Hide ]
Using Neobook Syntax Highlighting
WhileEx "[WebBrowser1Status] = Done"
  SetVar "[ParentAddress]" "[WebBrowser1Addr]"
  SetVar "[TextEntry1]" "[ParentAddress]"
EndWhile
Parsed in 0.005 seconds, using GeSHi 1.0.8.10


Yes, I think this works best of all! thanks Gaev!

:lol:
User avatar
fkapnist
 
Posts: 348
Joined: Mon Nov 17, 2014 4:24 pm
Location: Greece

Re: Webobject issue

Postby Gaev » Sat Nov 22, 2014 11:18 am

fkapnist:

There is no need for the WhileEx/EndWhile loop ... all event sections are triggered "once for each time the event takes place" ... in my test pub, all I had was ...
Code: Select all
SetVar "[webLog]" "[webLog]Navigate Complete: Addr=[WebBrowser2Addr] Status=[WebBrowser2Status][#13][#10][#13][#10]"

... the variable [weblog] was then written to a file that I could view with notepad.exe

So all you need is ...
Code: Select all
If  "[WebBrowser1Status]" "=" "Done"
  SetVar "[ParentAddress]" "[WebBrowser1Addr]"
  SetVar "[TextEntry1]" "[ParentAddress]"
EndIf
User avatar
Gaev
 
Posts: 3716
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: Webobject issue

Postby fkapnist » Mon Dec 29, 2014 3:12 pm

Gaev wrote:fkapnist:

There is no need for the WhileEx/EndWhile loop ... all event sections are triggered "once for each time the event takes place" ... in my test pub, all I had was ...
Code: Select all
SetVar "[webLog]" "[webLog]Navigate Complete: Addr=[WebBrowser2Addr] Status=[WebBrowser2Status][#13][#10][#13][#10]"

... the variable [weblog] was then written to a file that I could view with notepad.exe

So all you need is ...
Code: Select all
If  "[WebBrowser1Status]" "=" "Done"
  SetVar "[ParentAddress]" "[WebBrowser1Addr]"
  SetVar "[TextEntry1]" "[ParentAddress]"
EndIf


Not working... Everything that finishes downloading returns a "Done" value, including iframe ads... see this sample PUB: http://www.neosoftware.com/community/viewtopic.php?f=24&t=20860&p=11216073#p11216073
User avatar
fkapnist
 
Posts: 348
Joined: Mon Nov 17, 2014 4:24 pm
Location: Greece

Re: Webobject issue

Postby Gaev » Mon Dec 29, 2014 4:34 pm

fkapnist:
Not working... Everything that finishes downloading returns a "Done" value, including iframe ads

If it does not work for a particular web page content, go back to the basics i.e. capture the [WebBrowser1Addr] values at each event trigger ... then examine the values to determine best way to capture desired url (or post the log of all captured url values here).
User avatar
Gaev
 
Posts: 3716
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: Webobject issue

Postby fkapnist » Mon Dec 29, 2014 8:05 pm

Gaev wrote:fkapnist:
Not working... Everything that finishes downloading returns a "Done" value, including iframe ads

If it does not work for a particular web page content, go back to the basics i.e. capture the [WebBrowser1Addr] values at each event trigger ... then examine the values to determine best way to capture desired url (or post the log of all captured url values here).


I want to create a new web browser project and am not concerned about any particular URL. I only hope that most URLs will display correctly with the right address in the browser's address bar.... I somehow thought it to be easier than having to scan through a list to capture each URL. I suspect a snippet of code is still waiting to be discovered?...

As Gaev suggested for "Navigation Complete" I used

Code: Select all
If  "[WebBrowser1Status]" "=" "Done"
  SetVar "[TextEntry1]" "[WebBrowser1Addr]"
EndIf


But YouTube gives me goobledeygook like this:

https://accounts.google.com/o/oauth2/po ... cesecure=1
or
about:blank


:oops:

.
User avatar
fkapnist
 
Posts: 348
Joined: Mon Nov 17, 2014 4:24 pm
Location: Greece

Next

Return to General NeoBook Discussions

Who is online

Users browsing this forum: No registered users and 2 guests