Grabbing the HTML within a div / class / id from another website - wordpress

I'm currently creating a website using Wordpress. On one of the pages I want to extract news articles from another website, but I don't want to use iframe (I want to style it with css), nor do I want the entire page, just what's within the text of the article.
I'm pretty new to coding (which is one of the reason why I'm using wordpress), so I'm not sure how to go about it. I've looked around online, but the answers are either different from what I need, or they're far beyond my understanding. If there's some sort of wordpress plugin that does the job for me, that'd be great, but otherwise I'd be grateful to be pointed in the right direction.
Thanks.

Look for RSS feed, it might contain the content you need and its easier to grab things from RSS than from HTML. Or simply download the page via any programming language into object and find the element with either REGEX or Xpath.
Or use WordPress WebScraper plugin: Here

Related

How to customise content elements in typo3?

I have just begun my Typo3 journey. There is not much typo3 content available over the internet. I have gone through its documentation. As far as I have understood it, the ideal way of creating a website (frontend) is using content elements from backend and customising it according to our need in code (using CSS).
My Question is how can I do so? How can I find the code of all my used content elements so that I can use my own CSS to style it according to my need?
Or is there any other ideal or professional way of creating a webpage that mostly developers use?
Please please help me with my questions.
THANK YOU IN ADVANCE :)
I suggest to look into one of the following 2 extensions which allow to create content element types within a nice backend module:
https://extensions.typo3.org/extension/mask
https://extensions.typo3.org/extension/dce
Both come with a manual and it is afterwards easy to adopt the based default templates and apply the HTML you need
for the page structure I suggest to use something like https://jweiland.net/typo3/typo3-template-version-11.html or the bootstrap package https://www.bootstrap-package.com/ which also come with various custom content elements already
if you are german speaking you can also take a look at the video tutorials of wolfgang wagner which can be found at https://wwagner.net/
The base frontend structure of a TYPO3 websites is:
page templates (usually contain generic elements such as header,
footer, navigation.
page templates can be devided into serveral sections if needed
content elements which are than displayed in this sections / in
templates
The core already ships a set of common content elements and supplies basic CSS styling which you can override and adjust.
I prefer to check what kind of content elements I might need in order to get the website layout done and then build those custom elements. This gives full control over the HTML markup output and I can write my custom CSS specifically for my markup. This approach might need more initial work and requires a deeper understanding of the system, but often pays off in the end.
But if you want to see quick results as a beginner the approaches Georg mentioned with Mask or the bootstrap package are perfectly fine.

Crawling a list of URLS for specific links and Javascript

I have little experience with crawling and need help:
I have a list of URLs and I want to find out whether a certain tool is used on the websites.
The tool is working via an iframe which is loaded when a link with a specific URL is clicked.
So I am looking through the websites for this link. The problem I have is that sometimes this link is in an anchor element but sometimes it is in a javascript function (onclick on a button).
So the anchor element I can find (I tried around with different scraping frameworks like scrapy), but how do I find it when the link is in the function?
Is there an easier approach to the problem than looking for the -elements? E.g., downloading all html and all javascript and searching these files for the link? Because other than in classic crawling I do not want to extract structured data but rather know whether there is a specific link somewhere on the pages?
Thanks so much for any help or ideas!
Best
Martin

What is the preferred way to add custom data to a Wordpress theme?

I've read a number of articles and tutorials on adding custom content to a Wordpress theme. They almost always refer to small bits of data such as telephone numbers or emails that can be easily handled by using the option mechanism in Wordpress. This is fine and I've managed to implement the same functionality in a number of ways.
My question is;
If I wanted to add an option for the author to have some custom content on the home page - say a banner image, a paragraph of text (that uses the HTML editor) and a link to another page, what would be the most Wordpress friendly way of doing this?
I should probably mention that I'm not looking for a how-to or step by step, just opinions!
The best way to do this is using the settings api. A good tutorial for this is on wp.tutsplus, Its quite long. A shorter is from Otto.
It can be quite confusing at the beginning, but it's not that hard.

From static blogging to manual html editing?

I have my site done with WordPress. It's been like that for a few years.
Now, I have started to look for other options. WordPress has all these things I don't really need. One option would be static blogging. Generate the content locally and deploy the generated content to web with rsync, for example. There is tools like Jekyll, Hyde and Octopress for this.
But even Octopress seems like an overkill for me. It really feels like that. I don't need all those plugins it comes with. I'm building an image heavy site for myself, just a place where I can put my drawings that I create with my tablet.
So what if I would just manually edit HTML-files, where every file would become "a post" and make an index for them at root of my site? Come to think of it, I could work faster with this type of solution, even compared to Octopress. I could have a blank "post template" as raw html and set it as fill in snippet in TextExpander. In there, I could fill all the details for that html file like the title tag and so on.
I'm not really a coder. I draw things and write stories. In spite of this, I somehow have managed to work my way around with WordPress and recently, with Octopress.
I'm just thinking why Jekyll or Octopress or Hyde or Cactus would be a better fit for me instead of manually editing html files, and calling them "articles" or "posts"?
Thanks for any views or answers.
Why do you want to go to static html?
If you have problems with using too many resources, you should add a caching plugin to your WordPress install and that will help greatly.
Most of the time you still want some "dynamic" functionality that happens every time you add a page. For example you probably want to have a RSS/Atom feed so that people can subscribe to your site. And you want that automatically updated when you add a new page. You probably also want something to generate a sitemap file for the search engines to index it better.
These static site generators are able to do that well, so I would recommend using one.

Should I use custom taxonomy or custom post type?

I've recently taken on a project from a client of mine, after a lot of persuasion I've managed to finally get the website under some kind of CMS. I'm pretty new to Wordpress I've come from an ExpressionEngine background and fancied trying something new for a change, so excuse the lack of knowledge (I'm trying my best! :D).
Now The issue I'm currently facing is that they have very specific directions regarding how they want their content displayed on their website and more importantly how they would like to manage it. They are a travel agent I'm currently putting together the resort directory that will display all of the resorts they offer.
In regards to the current structure of the directory it will be made up of 4 different sections. To give you a better understanding of how I want things to work take a look at this hierarchy below, (I've used turkey as an example, these would need to be dynamic):
/destinations/ This will be our destinations page that will list
all of the countries they currently
offer. I imagine this to be a static
page with some content about the
countries on offer with a list of the
countries below (These will be our
parent taxonomies).
/destinations/turkey/ This will be our parent taxonomy. This
page will also have to have the
ability to add some static content to
insert information about the country
and its locations. Below this will be
a second list, these will be the
different areas of turkey (These will
be children of the parent
taxonomies).
/destinations/turkey/belek/ This will be our child taxonomy, This
page will again need to have the
ability to add some static content.
It will also include our list of
resorts that my client offers within
this location (These will be our
entries/posts).
/destinations/turkey/belek/resort-name
This will be our post/entry page,
here we will have all of the
information on the select resort, the
specifics of this aren't an issue and
I've already got this sorted.
Now, I've done a lot of reading up on custom post types, custom taxonomies and their abilities and uses but I'm hit with a situation at the moment where I can't decide on which route I should take. I've been experimenting over the last few hours with the setup of one custom post type (for resorts) and one hierarchical taxonomy (for locations). Which works some what ok BUT due to the limitations of the taxonomy UI within the admin panel it doesn't allow me to add my static content/images etc. (I'd much prefer to use a WYSIWYG especially from a clients point of view).
So this makes me wonder if it would be worth making two custom post types and scrapping taxonomies all together, making one of the post types resorts and the other locations. With the locations post type I could set it up like the pages module (which would give me hierarchical controls to allow me to organise my locations how I had originally planned) but is this a wise move? I mean from what I've read you shouldn't really organise content this way but I've got a feeling that maybe just a clash of contextual semantics (I could be wrong!). Would there be any limitations for me setting things up this way should I wish to add search functionality in the future? Or anything else for that matter?
I thought I'd mention this before I FINALLY click the submit button (apologies for the great wall of text) but pages... I've read here that they are powerful little gems within Wordpress, how should I be taking advantage of these if I'm using custom taxonomies? How well do they work with listing categories are they what I need?
Right, that about wraps up everything I've got to ask for now - maybe I should have split this into a few posts but hey! I hope this gives you guys enough information about what I'm trying to achieve and please if I am going wrong feel free to point me in the right direction I'm really eager to learn more about Wordpress and it's capabilities.
Regards
Danny
While this is one approach, it sounds like what you really want to be using (rather than custom post-taxonomies) is simply the Page functionality of WP. Everything you're describing is simply the hierarchical structure of the navigation of your pages. Yes, you can use the custom taxonomies to accomplish this same thing, but since you're describing things that tend to be "one" thing (ie: a single resort) you probably don't need the taxonomies.
You might want to look at another option: PODS CMS http://podscms.com
This will give you a simple structure to add custom features to your posts relatively easily... Things like pricing, amenities, and other "organizable" details can be stored using PODS and then referenced across your site for better usability. It might be worth a look!

Resources