Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to make EXE with LA?
#1
Hi Gintaras, 

I seem to be addicted to using LA to crawl web resources. Big Grin  May I have some questions?

1.How to make exe with LA? I've reviewed the instructions(Cookbook) in detail but still don't have a general idea.

2.How to terminate the scripts which are running at one mouse click? It's that possible to run the scripts background (Without opening LA).


3.Why does finding elements by xpath work for some elements and not for others? In the following example, I found the xpath successfully, but when I run it, I get a ”System.NullReferenceException: Object reference not set to an instance of an object. ” Please help me check it where was the problem?

Thank you so much!





Code:
Copy      Help
/*/ nuget -\HtmlAgilityPack; /*/
using HtmlAgilityPack;

script.setup(trayIcon: true, sleepExit: true);
var web = new HtmlWeb();
for (;;) {
    var doc2 = web.Load("https://www.toutiao.com/");
    var title = doc2.DocumentNode.SelectSingleNode("/html/body/div[1]/div/div[5]/div[2]/div[2]/div/div/div/ol/li[1]/a").InnerText;
  
    osdText.showTransparentText($"{title}");
    
     20.s();
}
#2
1. In Properties select role exeProgram. Then compile or run the script.

2. Two questions, both unclear.

3. I guess because HtmlAgilityPack does not run javascript. I guess you got the xpath from a web browser, which runs javascript. The final HTML after running javascript often is different. Maybe even initial HTML is different, eg depends on user-agent or cookies.
#3
Thank you for your reply. Regarding question 2, if multiple scripts are running simultaneously, is there a way to stop all of them with just one mouse click? Also, how can I make certain features like toolbars default to displaying with the window instead of having to open LA and run the specific toolbar script every time.
#4
To end multiple scripts with mouse - no. Can be used other ways. Read cookbook recipe "End script task, pause, exit".

Other question. Use triggers. For example window triggers for toolbars. Everything is in the TT menu.
#5
I never used multiple scripts in such a way that I would want to end all of them. Maybe it's better to use multiple threads in single script.
#6
I found it and now it has been correctly set up. Thanks a lot!


Forum Jump:


Users browsing this thread: 3 Guest(s)