Page 1 of 1

Cut the desired HTML among many similar

Posted: 18 Dec 2022, 22:14
by SeoLuxeR
Hi all

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?

1) The unique code is stored in the TXT file, therefore it should go to the variable, and with the variable to the tent for editing HTML
2) after the entire procedure, you need to clean the txt file so that it is empty

I made code sketches, help to finalize my development)


Script - https://drive.google.com/drive/folders/ ... sp=sharing

Re: Cut the desired HTML among many similar

Posted: 18 Dec 2022, 23:09
by eureka
I have downloaded your list of banks to understand more your goal.

Although Actiona might be able to parse such HTML for this application I suggest using a “toolchain”.
I build many toolchains. Rather like Zapier.com.

- Actiona to select various banks from a list (Combo box).

- An embedded Python script which exploits BeautifulSoup to parse the selected URL.

https://realpython.com/beautiful-soup-w ... er-python/

Python script can be written and tested separately then placed in Actiona toolbar > Scripts > Resources.

Then such Python (or other) resources can be run in a Detached Command object using a command like:

python parseHTML.py

There is no need to give the full path to the Python script since it is embedded in actiona.

In short a hybrid approach. Actiona front end <--> Python script (backend resource)

"Horses for courses" is the expression which comes to mind.

Re: Cut the desired HTML among many similar

Posted: 19 Dec 2022, 08:08
by SeoLuxeR
Bro,

I need to implement everything in actiona :cry:

Re: Cut the desired HTML among many similar

Posted: 19 Dec 2022, 08:10
by SeoLuxeR
I already have a local HTML file from which you need to cut the lines placed in 1.txt, save the change

After cleaning the HTML file you need to make a 1.txt empty file

Help plz :cry:

Re: Cut the desired HTML among many similar

Posted: 19 Dec 2022, 08:21
by SeoLuxeR
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.

Re: Cut the desired HTML among many similar

Posted: 19 Dec 2022, 08:44
by SeoLuxeR
1) I open html file
2) How to insert the Variable of 1.txt into Variable and replace it with an empty cage using the example of the code below?
Lecture = Lecture.replace(/$1.txt/g, delete);

Code: Select all

variable="$1.txt"

var file_in = new File();
file_in.open('c:/temp/index.html', File.ReadOnly);
var Lecture = file_in.readText();
file_in.close();

Lecture = Lecture.replace(/$1.txt/g, delete);

var file_out = new File();
file_out.open('c:/temp/index.html', File.WriteOnly);
file_out.writeText(Lecture, 'UTF8');
file_out.close();

Re: Cut the desired HTML among many similar

Posted: 19 Dec 2022, 09:58
by eureka
We now have crossed threads. See latest thoughts in French forum.

I would like to see the URL to your online source wiki, rather than static files which I cannot access to suggest ideas using Python.