← Back to team overview

sikuli-driver team mailing list archive

[Question #258964]: Write in file domain names

 

New question #258964 on Sikuli:
https://answers.launchpad.net/sikuli/+question/258964

Hello. I have a difficult task.
I download a lot of files in Google Chrome, and I need a script to copy to a text file name of the domain when the condition (if does not exist specific image after downloading). 
The principle is as follows:
There is a page with links extending to each other, in a column.Like this:

link 1
link 2
link 3
etc

1. Click on the first link
2. Wait for the downloaded files. If you see an image - click on the following link.
3. If the image does not appear - to copy the name of the domain from which you downloaded the file. Link format 
"domain.com/sometext/file.exe"
Need to copy only the domain name (domain.com), and save it as a text file.
4. Delete files from the folder "downloads" (this can be done by running simple external bat file.
5. Click on next link. etc

There are 2 problems:
- How to copy only the domain name and where to take it? need to open the page by downloads? Then in this case, you need to clean every time the list of downloaded files, to avoid excess.
- How to save a text file each time a new line?
Are there any examples of this code?

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.