Cut the desired HTML among many similar

Post here if you need help using Actiona
Post Reply
SeoLuxeR
Posts: 9
Joined: 18 Dec 2022, 21:28

Cut the desired HTML among many similar

Post 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
Attachments
script.ascr
(3.72 KiB) Downloaded 35 times
1.txt
(1.67 KiB) Downloaded 32 times
eureka
Posts: 204
Joined: 08 Mar 2016, 22:18

Re: Cut the desired HTML among many similar

Post 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.
SeoLuxeR
Posts: 9
Joined: 18 Dec 2022, 21:28

Re: Cut the desired HTML among many similar

Post by SeoLuxeR »

Bro,

I need to implement everything in actiona :cry:
SeoLuxeR
Posts: 9
Joined: 18 Dec 2022, 21:28

Re: Cut the desired HTML among many similar

Post 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:
SeoLuxeR
Posts: 9
Joined: 18 Dec 2022, 21:28

Re: Cut the desired HTML among many similar

Post 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.
SeoLuxeR
Posts: 9
Joined: 18 Dec 2022, 21:28

Re: Cut the desired HTML among many similar

Post 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();
eureka
Posts: 204
Joined: 08 Mar 2016, 22:18

Re: Cut the desired HTML among many similar

Post 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.
Post Reply