spa3212 1 Posted January 21, 2020 Report Share Posted January 21, 2020 I don't if it's possible or its already there but I couldn't find a way to set title or commands, so that one can identify what that particular command is for. like I have a command of many loops but how to set its name like Loop-for login, loop for images etc, I know define can do this but other than this. Quote Link to post Share on other sites
PRO 69 Posted January 21, 2020 Report Share Posted January 21, 2020 As of my knowledge you can either: - use a define in order to create a custom named chain of commands.- just place a "comment" above your command and write within this comment. 1 Quote Link to post Share on other sites
spa3212 1 Posted January 21, 2020 Author Report Share Posted January 21, 2020 thanks this is what I was looking. Quote Link to post Share on other sites
HelloInsomnia 1103 Posted January 21, 2020 Report Share Posted January 21, 2020 If you keep your commands small, name them well, and follow a high level -> low level structure then your code will read better. High level commands will just say what things do. Low level commands will do the work. For example to search Google you might have a high level command named SearchGoogle. This might contain a couple of commands in a loop: NavigateToSearchPage, ScrapeResults. Each of those might contain the actual logic. When you read the code you can see that it searches Google. If you need to see what that does then go to it and you will find that it loops and navigate to the pages and then scrapes the results. If you then need to dive deeper you can go down to the bottom level (NavigateToSearchPage, and ScrapeResults) which actually clicks on next page or parses the results from the page. Of course this example is small you probably don't need to go this far for a small script. But when you have a larger project this makes a big difference. 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.