I have a long list of URLs and I want to extra the title from each one and save it into an Microsoft Excel file.
I tried looking around for the code to do this but could not find it. I'm using iMacros for Firefox.
I would suggest using internet explorer object along with MSHTML object library in excel VBA itself which may take off using 3rd party applications.
You need first the list of URLs in a file (one URL in each line). Let's call it listOfUrls.csv (save as from Excel or just use a plain text file). You place that file in the iMacros/Datasources folder.
Then the macro itself:
SET !DATASOURCE listOfUrls.csv
SET !DATASOURCE_COLUMNS 1
SET !LOOP 1
SET !DATASOURCE_LINE {{!LOOP}}
TAB T=1
URL GOTO={{!COL1}}
TAG POS=1 TYPE=TITLE ATTR=* EXTRACT=TXT
SAVEAS TYPE=EXTRACT FOLDER=* FILE=openThisInExcel.csv
Now you have to play the macro as Loop (look for "Play (Loop)"). Play is as many times as URLs you have in the list (set that in "Max:"). Then the macro will take you to each URL and get the title and save it into openThisInExcel.csv. That's it.
You may also want to keep the URL in the result CSV (so you know which Title correspond to which URL). Add the following before the last line or the line before that one (depending on the column order you want):
ADD !EXTRACT {{!URLCURRENT}}
Related
I noticed that when GitHub pages with mkdocs have text or images in between numbers it ignores the numbering in the source document and instead restarts numbering. See here for an example of this.
Is there a way to force mkdocs to render the numbers in the original document instead of inventing its own?
If you add them all as 1. space and text, then sub item as image with a tab, it should work. As an example:
1. Option 1
imgage or next text
1. Option 2
You can check this documentation built using mkdocs as an example.
As Zoran mentioned above that was part of it. Things I figured out:
Code must be double tabbed - you cannot use ```
Indented lists must also be double tabbed - I wasn't able to get a single tab to work
Images do not have to be tabbed - they can be in line with the above text
There should not be an empty line when an image follows a numbered list item BUT FOR CODE there must.
I still haven't completely figured out. mkdoc's behavior is not as predictable as regular markdown
I have a document with over 1000 images (set a), each of which are sitting on separate folder and I am loading them into my word document by entering the path in a "field". The images get uploaded to the word document and displayed.
I have another 1000 images (set b), all of which are named in the exact same way, except that they all end a different letter (b instead of a). I have tried to take my pre-existing and working word document that displayed the first 1000 images (set a), and edit the path in the field so that they all reference the set b images. This change is easy to make as I just need to find and replace everywhere that the text image_a.pngappears with image_b.png.
However, when I do this, the images don't actually refresh and are instead still displaying all of the images from set a. I have played around with a lot of stuff like saving the document as and opening it again, and for a separate issue I had to enter and exit print preview for my number sequence to update, and I tried that for this issue, but that still doesn't help. The only thing that I have found that works is if I go to each field individually, right click on it and select "edit field" and then select ok, and then the correct image will be displayed. However this is not a practical solution because I would have to do this over 1000 times. Does anyone know what is going on here and does anyone know a way to refresh/update all of the 1000 images at once?
Thanks!
Try Ctrl+A followed by the F9 key. You may need to press an Fn key with the F9.
If you need something more nuanced, I can provide a macro. For that, I would need the name of the field being used.
You may want to look at Paul Edstein's tutorial on relative paths in fields.
I am automating the process of downloading information off of a site. As I can only search for (and then download) data from two days at a time, sometimes there is no data to be downloaded.In this instance, when the macro clicks the "download button, the following dialog box appears.
If there are listings to export, the macro proceeds through selecting a few options and downloading a file. However, if the dialog box above appears I would like the macro to skip the next few steps and proceed to a step several lines ahead. Is there any way to do this?
In brief, there can be several ways to do that which depend on your browser and 'iMacros'.
Here is one of them:
SET !EXTRACT_TEST_POPUP NO
SET msgText "No listings to export"
SET !ERRORIGNORE YES
TAG POS=1 TYPE=* ATTR=TXT:{{msgText}} EXTRACT=TXT
SET nextPos EVAL("'{{!EXTRACT}}'.match(/{{msgText}}/) ? '0' : '1';")
' your next steps
TAG POS={{nextPos}} TYPE=A ATTR=...
' ...
SET !ERRORIGNORE NO
If you play this code in loop mode, it's possible
to skip the next few steps and proceed to a step several lines ahead.
I wrote this code for iMacros:
SET !EXTRACT '<html><head></head><body><p>TEST</p></body></html>'
SAVEAS TYPE=EXTRACT FOLDER=E:\MyFolder FILE=test.html
But instead of HTML file, I get CSV file with name "test.html" and extension ".csv"
Same goes if I try with FILE=test.txt or any other format, it simply always saves files with CSV extension.
Is there any way to change file extension?
Perhaps this workaround will be helpful to you:
SET !EXTRACT "<html><head></head><body><p>TEST</p></body></html>"
SET !EXTRACT EVAL("'{{!EXTRACT}}'.replace(/</g, '<').replace(/>/g, '>');")
TAB OPEN
TAB T=2
URL GOTO=javascript:'{{!EXTRACT}}';
WAIT SECONDS=0.5
SAVEAS TYPE=TXT FOLDER=E:\MyFolder FILE=test.html
TAB CLOSE
TAB T=1
How would you copy the code from this example page
http://framework.zend.com/manual/en/learning.quickstart.create-layout.html
(Below the text "Now that we've initialized Zend_Layout and set the Doctype, let's create our site-wide layout:" )
A simple copy paste will also copy the line number or #. Any tricks ?
I hate these line numbers as well. The way I do it:
Copy the text to your favorite text editor (notepad won't do, Word for example would) and block-select using the ALT Key.
Let me give you an example with Notepad++. here I copied text from the said site with all line numbers included. Now I just hold the ALT button and select normally with my mouse (or using SHIFT+arrow keys). The result of me selecting only the code sans the line numbers you see in the following screenshot:
Now I could just copy this code to a new editor.