Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to get a specific part, or div of a website
    primarykey
    data
    text
    <p>What I would like to do: get the text headline from the top post on <a href="http://reddit.com/r/worldnews" rel="nofollow">http://reddit.com/r/worldnews</a> and output it to a webpage of mine that will only have that text on it. </p> <p>In the end, I would like to grab the text from that webpage that I made using AppleScript cURL and output it.</p> <p>I am making a script that when I click the button it will tell me the top post.</p> <p><em>edit</em> If you can think about any way, I would like to do the same thing, but for Facebook notifications.</p> <p><em>edit</em> I have PHP grabbing the site and outputting here: <a href="http://colejohnsoncreative.com/personal/ai/worldnews.php" rel="nofollow">http://colejohnsoncreative.com/personal/ai/worldnews.php</a> This is the code that I am using:</p> <pre><code> &lt;?php // Get a file into an array. In this example we'll go through HTTP to get // the HTML source of a URL. $lines = file('http://www.reddit.com/r/worldnews'); // Loop through our array, show HTML source as HTML source; and line numbers too. foreach ($lines as $line_num =&gt; $line) { echo "Line #&lt;b&gt;{$line_num}&lt;/b&gt; : " . htmlspecialchars($line) . "&lt;br /&gt;\n"; } // Another example, let's get a web page into a string. See also file_get_contents(). $html = implode('', file('http://www.example.com/')); // Using the optional flags parameter since PHP 5 $trimmed = file('somefile.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); ?&gt; </code></pre> <p>So I get all of the site's code to output, but all I need for the project is </p> <pre><code>&lt;a class="title " href="http://www.dailymail.co.uk/news/article-2219477/Cannabis-factory-couple-gave-400-000-drug-dealing-fortune-poor-Kenyans-jailed-years.html" &gt;British couple who spent most of the money they made from canabis growing on paying for life changing operations and schooling for people in a poor Kenyan village gets sent to prison for 3 years.&lt;/a&gt; </code></pre> <p>and everything else I need to throw away, how can I do that?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload