Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4592940
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T22:36:43+00:00 2026-05-21T22:36:43+00:00

I have a hard time visualizing and conceiving away to scrape this page: http://www.morewords.com/ends-with/aw

  • 0

I have a hard time visualizing and conceiving away to scrape this page: http://www.morewords.com/ends-with/aw for the words themselves. Given a URL, I’d like to get the contents and then generate a php array with all the words listed, which in the source look like

<a href="/word/word1/">word1</a><br />
<a href="/word/word2/">word2</a><br />
<a href="/word/word3/">word3</a><br />
<a href="/word/word4/">word4</a><br />

There are a few ways I have been thinking about doing this, i’d appreciate if you could help me decide the most efficient way. Also, i’d appreciate any advice or examples on how to achieve this. I understand it’s not incredibly complicated, but I could use the help of you advanced hackers.

  • Use some sort of jquery $.each() to loop through and somehow case them into a JS array, and then transcribe (probably heavily taxing)
  • use some sort of curl (don’t really have much experience with curl)
  • use some sophisticated find and replace with regex.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T22:36:44+00:00Added an answer on May 21, 2026 at 10:36 pm

    You tagged it as PHP, so here is a PHP solution 🙂

    $dom = new DOMDocument;
    
    $dom->loadHTMLFile('http://www.morewords.com/ends-with/aw');
    
    $anchors = $dom->getElementsByTagName('a');
    
    $words = array();
    
    foreach($anchors as $anchor) {
        if ($anchor->hasAttribute('href') AND preg_match('~/word/\w+/~', $anchor->getAttribute('href'))) {
            $words[] = $anchor->nodeValue;
        }
    }
    

    CodePad.

    If allow_url_fopen is disabled in php.ini, you could use cURL to get the HTML.

    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, 'http://www.morewords.com/ends-with/aw'); 
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    $html = curl_exec($curl);    
    curl_close($curl);   
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a malformed page to scrape, and have had a hard time getting
I have a hard time figuring this one out, it's about mistakes that can
I have a hard time grasping this. When writing in do notation, how are
Having a hard time figuring out the best way to do this... I have
I am having a hard time on this one, I have a folder over
I am having a really hard time getting this to work. I have two
I have a hard time grasping this memory leak in my code. Basically it's
I created this code from a tutorial but have hard time understanding a key
I'm currently learning Win32 using this tutorial , and I have a hard time
I have hard time to modify a page that had a Custom User Control

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.