Recent content by WebmasterHacks

  1. W

    [Tutorial] How to scrape web pages using PHP

    Part 5. Collections. Now we will add collections to our scraper. First create src/WebmasterHacks/VideoCollection.php file with this content: <?php namespace WebmasterHacks\Pornhub; class VideoCollection { protected $videos = []; public function add(Video $video) {...
  2. W

    [Tutorial] How to scrape web pages using PHP

    Part 4. Refactor. OK. Our scraper works already, but there is lot to improve. First of all let's see what we have done. We have Video object that represents video page. You can ask for data and it will return it. We have Pornstar object that represents... well pornstar page(s). You can...
  3. W

    [Tutorial] How to scrape web pages using PHP

    Example: $crawler->filter('.withBio img')->first()->attr('src');
  4. W

    [Tutorial] How to scrape web pages using PHP

    Part 3. Porn star page. Now we know how to scrape data from video page URL. It's time to parse those URLs. Let's start with porn star page. $client = new Client; $crawler = $client->request('GET', 'dirtysite/pornstar/madison-ivy'); $urls = $crawler->filter('.videos .videoblock .title...
  5. W

    [Tutorial] How to scrape web pages using PHP

    Yes, thats true. I really don't know skill level of readers, that's why I'm skipping some parts. But I will keep in mind that this can be a problem. That's why feedback is so important. Mby will do some additional part about CSS selectors. This is the next step :D I'm just checking if someone...
  6. W

    [Tutorial] How to scrape web pages using PHP

    Part 2. Video page. We already know how to get title from page, let's scrape everything else. Porn stars... If you open your browser's developer tools you will see that porn stars links are inside element with class "video-info-row" and it contains "Pornstars" word. Also there are...
  7. W

    Hello world! Code guy here :)

    Started tutorial in "PHP & Perl" category. I don't think it belongs in "Making Money". It's not a method on how to get rich. Just a little tips about developing tools. But you can move it anywhere you want :D
  8. W

    [Tutorial] How to scrape web pages using PHP

    Part 1. Composer. We will use Composer for dependency management. Why the hell you need to reinvent the wheel, then there is a lot of great libraries, that was used and tested by thousands of people? Even better! We will just say which libraries we need and Composer will download them for us...
  9. W

    [Tutorial] How to scrape web pages using PHP

    Hello BHW community! Today I'm gonna show you how to scrape (parse) web pages using PHP. As an example I choose PornHub :) Why? 1. A lot of people using content from adult websites for their projects. 2. It's a really good example for parsing. They have video page, categories, tags...
  10. W

    favicon automatically appears

    This is default browser behavior. It will make request for root/favicon.ico automatically, unless you provide favicon location in meta tag.
  11. W

    Hello world! Code guy here :)

    Does anyone has any suggestions about website I could scrape? Of course for the sake of example we can parse BHW users Skype accounts, but I think it would be better to write something useful.
  12. W

    Hello world! Code guy here :)

    Hi everyone! I am a web developer and I want to share few tips and tricks with BHW community. As I saw on this forum sometimes people have troubles with automating their job. There are a lot of different solutions, but they are not equally good. I can show you ways of developing good...
  13. W

    some small help with PHP contact form

    You can use build-in filter_var function. <?php if (!filter_var($subject, FILTER_VALIDATE_URL)) { $error_message .= 'The url you entered does not appear to be valid.<br />'; } P.S. JavaScript validation is not used for security, it just helps user to see what's wrong...
Back
Top