You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How to download files from website using Automator

I have problem in downloading files from website.

I extract urls from specified website and saved them in .txt files.

I want to open these saved urls and then download them as pdf.

But the instruction cannot be implemented .

Can someone help me solving this problem?

Thx :)

iMac 21.5″, macOS 10.15

Posted on Sep 14, 2021 1:02 AM

Reply
Question marked as Top-ranking reply

Posted on Sep 14, 2021 9:20 AM

Your workflow is incorrect for what you ask.


I'm assuming that the URLs in the source page are the .PDFs you're trying to download, so that's OK.


The issue is that the New Text File action returns the file that was created to contain the files.

This is passed into Extract URLs from Text. You are expecting this action to see the text written to the file. It does not. It sees the path of the file that was created.


You have two options - you can pass the output from Filter URLs directly into the Download URLs action (i.e. there is no need to write to the intermediate file.

If you do need the intermediate file (i.e. a log of files downloaded), then you need an additional action to read the file back in and pass the contents of the file to the Download URLs action.

2 replies
Question marked as Top-ranking reply

Sep 14, 2021 9:20 AM in response to yuqiong777

Your workflow is incorrect for what you ask.


I'm assuming that the URLs in the source page are the .PDFs you're trying to download, so that's OK.


The issue is that the New Text File action returns the file that was created to contain the files.

This is passed into Extract URLs from Text. You are expecting this action to see the text written to the file. It does not. It sees the path of the file that was created.


You have two options - you can pass the output from Filter URLs directly into the Download URLs action (i.e. there is no need to write to the intermediate file.

If you do need the intermediate file (i.e. a log of files downloaded), then you need an additional action to read the file back in and pass the contents of the file to the Download URLs action.

Sep 14, 2021 5:53 AM in response to yuqiong777

There is no provision in Automator, or any other application in macOS to create a PDF from the visual contents of a website whose URL you have in a text file. The other challenge is of recreating the style and layout of the website in the PDF.


From a Google search on Website content to PDF, you may find a tool that does this for you, or that you can incorporate into Automator to work off your text file list of URLs.

How to download files from website using Automator

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.