Group Abstract Group Abstract

Message Boards Message Boards

0
|
4.7K Views
|
4 Replies
|
1 Total Like
View groups...
Share
Share this post:

How to run a loop function for a list of hyperlinks

Posted 6 years ago

Hello, I have written several codes to get the output data for one hyperlink. However, I would like to run these codes for 500 hyperlinks. Each of these hyperlinks is a 10-K document in a text(.htm) format. The codes I wrote import this hyperlink and analyze a few things. My question is, I have assembled a list of 500 hyperlinks for Wolfram to import, but I am not sure how to set up a loop function so that Wolfram conducts my code 500 times for the 500 different hyperlinks.

So far, this is what I have:

importfile = Drop[Import["importfile.xlsx"][[1, All, 4]], 1];
cleanproxy = Flatten@importfile;
Cases[Import[cleanproxy[[1]], "Hyperlinks"], StringContainsQ["https://www.sec.gov/"]]

While my main code is below these three lines, I am stuck as to how to get WM to conduct the main code for the 500 hyperlinks that I feed to WM. I currently have over 30 main code lines and I wasn't sure if I could still use the Do function to fit all 30 codes into one Do function if possible. I presume that I need to set up something like f[x_] :=.... but I am stuck here.

Any help would truly be appreciated! Thank you in advance for your help!

POSTED BY: Young Il Baik
4 Replies
Posted 6 years ago

Almost identical question posted here.

POSTED BY: Rohit Namjoshi
Posted 6 years ago
POSTED BY: Young Il Baik
Posted 6 years ago
POSTED BY: Rohit Namjoshi
Posted 6 years ago
POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard