Couper le HTML souhaité parmi de nombreux similaires

Vous voulez de l'aide ? Postez ici :)
Post Reply
SeoLuxeR
Posts: 9
Joined: 18 Dec 2022, 21:28

Couper le HTML souhaité parmi de nombreux similaires

Post by SeoLuxeR »

Salut tout le monde

J'ai un fichier index.html avec un tas de code, et je dois en supprimer mon code «unique» qui est placé dans 1.txt sans endommager le reste des balises et des éléments du document HTML, comment cela pourrait-il être fait correctement?

1) Le code unique est stocké dans le fichier txt, donc il doit aller à la variable, et avec la variable à la tente pour éditer HTML
2) Après toute la procédure, vous devez nettoyer le fichier txt afin qu'il soit vide

J'ai fait des croquis de code, aider à finaliser mon développement)


Script - https://drive.google.com/drive/folders/ ... sp=sharing
eureka
Posts: 204
Joined: 08 Mar 2016, 22:18

Re: Couper le HTML souhaité parmi de nombreux similaires

Post by eureka »

See my suggestion in other forum.
SeoLuxeR
Posts: 9
Joined: 18 Dec 2022, 21:28

Re: Couper le HTML souhaité parmi de nombreux similaires

Post by SeoLuxeR »

eureka wrote: 19 Dec 2022, 00:00 See my suggestion in other forum.
The text in 1.txt to change every 60 minutes through another script, rather, the implementation through Python is not suitable for me since I can not integrate it dynamically.- :cry: :roll:
eureka
Posts: 204
Joined: 08 Mar 2016, 22:18

Re: Couper le HTML souhaité parmi de nombreux similaires

Post by eureka »

The text in 1.txt to change every 60 minutes through another script, rather, the implementation through Python is not suitable for me since I can not integrate it dynamically.
I do not agree, since the embedded python script (Script > Resource > python script) can be run over and over again, every 60 minutes if you so wish, controlled entirely by Actiona .. or a separate cron script outside Actiona.

Think of this as parallel processes working hand in hand.

Otherwise you are missing a trick in understanding this hybrid approach using a toolchain.

I still believe that BeautifulSoap is made for this purpose of URL parsing. If you hope to achieve this entirely within Actiona it will be doable but tougher.


======================================================

Postscript

After studying again I see that your list of wiki URL's is in fact a static dataset (file:///) rather than direct access to online dynamic datasets which of course will be updated from time to time.

Thus the Python BeautifulSoup approach only works when the source of each bank URL is searched and parsed. Why do you use a static database for your lectures?

What is the URL to online wiki?
SeoLuxeR
Posts: 9
Joined: 18 Dec 2022, 21:28

Re: Couper le HTML souhaité parmi de nombreux similaires

Post by SeoLuxeR »

I need to implement everything in Actiona, without connecting Python ... drop this idea
I do not use editing in online resources ... Look at my script again and understand what I want to do

We have local files in google disk : https://drive.google.com/drive/folders/ ... -cGq9j8XWB
1) index.html
2) 1.txt
3) script.ascr

A task :
I have an index.html file with a bunch of code, and I need to delete my “unique” code from it that is placed in 1.txt without damaging the rest of the tags and elements in the HTML document, how could this be done correctly?

Help me correct the code so that it function correctly on the example of the code below :

Code: Select all

variable="$txt_bd" // load variable txt_bd

var file_in = new File();
file_in.open('/home/script/index.html', File.ReadOnly); //  I open index.html
var Lecture = file_in.readText();
file_in.close();

Lecture = Lecture.replace(/$txt_bd/g, dellcode);  // Help me replace the code so that it works ( you need to set the value from the text file and replace them with an empty place / Delete )

var file_out = new File();
file_out.open('/home/script/index.html', File.WriteOnly); //  I save index.html
file_out.writeText(Lecture, 'UTF8');
file_out.close();



Lecture = Lecture.replace(/$txt_bd/g, dellcode); // Help me replace the code so that it works ( you need to set the value from the text file and replace them with an empty place / Delete

https://ibb.co/WzVx3Cg
https://ibb.co/MkKqBvN
https://ibb.co/4TStqJL
https://ibb.co/v4Qz72g
https://ibb.co/NZyCktm
Last edited by SeoLuxeR on 19 Dec 2022, 10:38, edited 1 time in total.
Post Reply