Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Finding images in HTML and moving them on server ?

Featured Replies

I need to search an HTML document for all the image files (gif,jpg.png) then print out the list of images; then search on a server for the image files printed from the previous list and take those image files which on in a directory or directories on the server and move them to another directory on the server ?

Do you mean move or copy?

 

If you move the images to another directory then if they are statically linked in the HTML page they will not appear on the page as the link paths will be broken.

 

Is this some sort of online function for users to break the pages or something else?

Why not just access the server using your FTP client and rename the folder in which the images are stored?

  • Author

There may be a more efficient way than this but I would probably:

 

Use curl inside a php script to scrape the HTML page.

Iterate over the nodes in the HTML and use a regular expression to pull out the image paths that you want into a list.

 

I'd then ssh onto the server and use mv commands to move the files in the list.

 

I hope that makes some kind of sense?

 

Makes sense; does such a script exist ?

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.