Jump to content



Photo

Html Not Updating


  • Please log in to reply
7 replies to this topic

#1 lolada

lolada

    Advanced Member

  • Members
  • PipPipPip
  • 44 posts
  • OS:Windows 7
  • Total Memory:More Than 9Gb
  • Framework:v4.5+, unsure
  • License:Developer Edition

Posted 30 July 2020 - 11:07 AM

Hello guys i'm having a problem because im using "ui html panel" and i want to make images changing while he scrapes from website, the problem is the link changes but ui html panel do not update it, the link of images keeps changing but html panel only show the first one (when bot started), if i stop the bot and edit the code of html panel, he updates to the last one again (only if i do manual). Any way to make ui html panel to update everytime is changes?

 

code html panel:

 

<img src= #image1 alt="HTML5 Icon" style="width:50px;height:50px;">
<img src=#image2 alt="HTML5 Icon" style="width:50px;height:50px;">
<img src=#image3 alt="HTML5 Icon" style="width:50px;height:50px;">
<img src=#image4 alt="HTML5 Icon" style="width:50px;height:50px;">


#2 stephenzeiner

stephenzeiner

    Advanced Member

  • Members
  • PipPipPip
  • 51 posts
  • OS:Mac OS
  • Total Memory:8Gb
  • Framework:v4.5+, unsure
  • License:Developer Edition

Posted 30 July 2020 - 01:18 PM

 

Hello guys i'm having a problem because im using "ui html panel" and i want to make images changing while he scrapes from website, the problem is the link changes but ui html panel do not update it, the link of images keeps changing but html panel only show the first one (when bot started), if i stop the bot and edit the code of html panel, he updates to the last one again (only if i do manual). Any way to make ui html panel to update everytime is changes?

 

code html panel:

 

<img src= #image1 alt="HTML5 Icon" style="width:50px;height:50px;">
<img src=#image2 alt="HTML5 Icon" style="width:50px;height:50px;">
<img src=#image3 alt="HTML5 Icon" style="width:50px;height:50px;">
<img src=#image4 alt="HTML5 Icon" style="width:50px;height:50px;">

 

 

Hi. I'm not entirely sure that I understood the question, but it sounds like you have an application that visits various websites. The application scrapes data from those websites. You'd like for various images within your UI HTML Panel to change as the aforementioned scraping takes place. (Am I understanding you so far?)

 

Something that immediately appears to be potentially problematic with the code snippet you shared is that the UBot Studio variables you mention (#image1, #image2, etc) are not surrounded by curly brackets. (Something that would look more like this: {#image1}) Also, the HTML <img> "src" attribute typically  has quotation marks around it. (Something that would look more like this: img src=" ").  



#3 lolada

lolada

    Advanced Member

  • Members
  • PipPipPip
  • 44 posts
  • OS:Windows 7
  • Total Memory:More Than 9Gb
  • Framework:v4.5+, unsure
  • License:Developer Edition

Posted 30 July 2020 - 11:28 PM

Hi. I'm not entirely sure that I understood the question, but it sounds like you have an application that visits various websites. The application scrapes data from those websites. You'd like for various images within your UI HTML Panel to change as the aforementioned scraping takes place. (Am I understanding you so far?)
 
Something that immediately appears to be potentially problematic with the code snippet you shared is that the UBot Studio variables you mention (#image1, #image2, etc) are not surrounded by curly brackets. (Something that would look more like this: {#image1}) Also, the HTML <img> "src" attribute typically  has quotation marks around it. (Something that would look more like this: img src=" ").


Thank you for answer, link of image is saved on a variable, what i want is when the link changes, the image on html panel updates.

#4 stephenzeiner

stephenzeiner

    Advanced Member

  • Members
  • PipPipPip
  • 51 posts
  • OS:Mac OS
  • Total Memory:8Gb
  • Framework:v4.5+, unsure
  • License:Developer Edition

Posted 31 July 2020 - 08:40 AM

Thank you for answer, link of image is saved on a variable, what i want is when the link changes, the image on html panel updates.

 

Ah okay, I think I understand.

 

This is what's happening. When you load the application, UI HTML Panel (which is classified as a UBot Studio command) is being executed. You can dynamically update the contents of various HTML/CSS components within the UI HTML Panel via the use of supplemental UBot Studio attributes such as "variable" and "fillwith" -- but in the case of the HTML "img" tag, it's unclear to me that the contents of the "src" attribute can be updated through the use of the supplemental UBot Studio attributes of "variable" and "fillwith" -- but I could be mistaken.

 

While it's true that the data stored within your "#image" variables is changing, the UI HTML Panel command is not reflecting those changes because as mentioned a moment ago it basically "runs" once and reads the contents of your "#image" variables at the time it's being run.



#5 stephenzeiner

stephenzeiner

    Advanced Member

  • Members
  • PipPipPip
  • 51 posts
  • OS:Mac OS
  • Total Memory:8Gb
  • Framework:v4.5+, unsure
  • License:Developer Edition

Posted 31 July 2020 - 08:49 AM

Actually... it just occurred to me that you might be able to solve your challenge by bypassing the use of the HTML "img" tag and the "src" attribute to display images. Depending on your situation, something like this might be a suitable alternative:

 

<div variable="#image1" fillwith="innerhtml"></div>

 

The above code would replace this (see below) inside your UI HTML Panel command:

 

<img src= #image1 alt="HTML5 Icon" style="width:50px;height:50px;">

 

What you'd then do is format the contents of the #image1 variable that is getting continually updated to look like this:

 

set(#image1,"<img src="https://example.com/image.png" alt="HTML5 Icon" style="width:50px;height:50px;">","Global")

 

You'd replace the HTML "img" tag "src" attribute with the corresponding link to the image you're seeking to display.

 

Hopefully this helps point you in a productive direction that ultimately leads to a viable solution.



#6 lolada

lolada

    Advanced Member

  • Members
  • PipPipPip
  • 44 posts
  • OS:Windows 7
  • Total Memory:More Than 9Gb
  • Framework:v4.5+, unsure
  • License:Developer Edition

Posted 31 July 2020 - 01:23 PM

Actually... it just occurred to me that you might be able to solve your challenge by bypassing the use of the HTML "img" tag and the "src" attribute to display images. Depending on your situation, something like this might be a suitable alternative:

<div variable="#image1" fillwith="innerhtml"></div>

The above code would replace this (see below) inside your UI HTML Panel command:

<img src= #image1 alt="HTML5 Icon" style="width:50px;height:50px;">

What you'd then do is format the contents of the #image1 variable that is getting continually updated to look like this:

set(#image1,"<img src="https://example.com/image.png" alt="HTML5 Icon" style="width:50px;height:50px;">","Global")

You'd replace the HTML "img" tag "src" attribute with the corresponding link to the image you're seeking to display.

 

Hopefully this helps point you in a productive direction that ultimately leads to a viable solution.

 

thank you for answer but it keeps not updating. The first link to image is what shows all the time, even when link changes it keeps showing the first image



#7 stephenzeiner

stephenzeiner

    Advanced Member

  • Members
  • PipPipPip
  • 51 posts
  • OS:Mac OS
  • Total Memory:8Gb
  • Framework:v4.5+, unsure
  • License:Developer Edition

Posted 31 July 2020 - 02:25 PM

thank you for answer but it keeps not updating. The first link to image is what shows all the time, even when link changes it keeps showing the first image

 

That's unusual, but not necessarily surprising. I've already seen a handful of scenarios where something that might work for one individual might not ultimately work for someone else. What version of UBot Studio do you happen to be using?



#8 lolada

lolada

    Advanced Member

  • Members
  • PipPipPip
  • 44 posts
  • OS:Windows 7
  • Total Memory:More Than 9Gb
  • Framework:v4.5+, unsure
  • License:Developer Edition

Posted 01 August 2020 - 01:00 PM

That's unusual, but not necessarily surprising. I've already seen a handful of scenarios where something that might work for one individual might not ultimately work for someone else. What version of UBot Studio do you happen to be using?


Im using 5.9 version




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users