Skip to content

Forum in maintenance, we will back soon 🙂

Web Scraping using ...
 
Notifications
Clear all

Web Scraping using PHP

7 Posts
3 Users
1 Reactions
525 Views
(@pathumsam)
Posts: 3
Active Member
Topic starter
 

How to extract article content from various websites using PHP?

 
Posted : 11/05/2023 6:46 pm
Hasan Aboul Hasan
(@admin)
Posts: 1257
Member Admin
 

Did you try ChatGPT?

 
Posted : 11/06/2023 11:58 am
SSAdvisor
(@ssadvisor)
Posts: 1139
Noble Member
 

@pathumsam in my decades of IT work I used PHP extensively and can say that it is a wonderful language. However, now that I've began using Python I can say that it is so much easier to learn and use. So I would like to ask; why do you want to use PHP?

Regards,
Earnie Boyd, CEO
Seasoned Solutions Advisor LLC
Schedule 1-on-1 help
Join me on Slack

 
Posted : 11/06/2023 3:38 pm
(@pathumsam)
Posts: 3
Active Member
Topic starter
 

@admin Yeah, My current approach extracts content from headers (<h1>, <h2>, etc.) and paragraphs (<p>). Still, I want to ensure that only the main article content is extracted, excluding any other non-essential text.

 
Posted : 11/06/2023 5:17 pm
(@pathumsam)
Posts: 3
Active Member
Topic starter
 

@ssadvisor Thank you for sharing your insights, and I completely agree with that. But I'm trying to create a WordPress tool with real-time data.

 
Posted : 11/06/2023 5:25 pm
SSAdvisor
(@ssadvisor)
Posts: 1139
Noble Member
 

@pathumsam you can use Python within the WordPress site. Check out this article by @Hasan: https://learnwithhasan.com/create-ai-tools-with-wordpress/

Regards,
Earnie Boyd, CEO
Seasoned Solutions Advisor LLC
Schedule 1-on-1 help
Join me on Slack

 
Posted : 11/07/2023 4:21 pm
Hasan Aboul Hasan
(@admin)
Posts: 1257
Member Admin
 

@pathumsam each website has it is own structure, if you want to extract articles from any page, either you need to create your own script or use a ready-made package, I really don't know if there is something like that in PHP, but in python, we have newspaper package that I showed in the course

 
Posted : 11/10/2023 12:31 pm
SSAdvisor reacted
Share: