lolada 1 Posted July 30, 2020 Report Share Posted July 30, 2020 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;"> Quote Link to post Share on other sites
stephenzeiner 12 Posted July 30, 2020 Report Share Posted July 30, 2020 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=" "). Quote Link to post Share on other sites
lolada 1 Posted July 31, 2020 Author Report Share Posted July 31, 2020 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. Quote Link to post Share on other sites
stephenzeiner 12 Posted July 31, 2020 Report Share Posted July 31, 2020 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. Quote Link to post Share on other sites
stephenzeiner 12 Posted July 31, 2020 Report Share Posted July 31, 2020 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. Quote Link to post Share on other sites
lolada 1 Posted July 31, 2020 Author Report Share Posted July 31, 2020 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 Quote Link to post Share on other sites
stephenzeiner 12 Posted July 31, 2020 Report Share Posted July 31, 2020 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? Quote Link to post Share on other sites
lolada 1 Posted August 1, 2020 Author Report Share Posted August 1, 2020 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 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.