Action based on page content - web-scraping

Is there any way of creating a scrapy rule based on content of page? The reason being is I am trying to create a crawler for a website which has a certain page that is displayed but the URL doesn't change, so I need the spider to recognize it is on that page from the content and then call a certain function.

Related

Next JS SEO dynamic Title

Im using a custom app.js and setting the SEO fields inside the head tag. I noticed that on the initial load the SEO title and other information are set in the head tags and when using the router to redirect to a new page, the SEO set initially will be there in the head tags but the title changes to the URL of the new route.
for example, the initial load the title of the tab would be WELCOME and the user clicks on a button that would redirect to someDomain.com/HEY. Now the WELCOME title is overwritten by someDomain.com/HEY, however, if I refresh the page when in the HEY page, I can see WELCOME title till the HEY page API calls are done.
As a temp fix, I am setting a title for all these pages in the respective head tags and the other fields have to be common. is this a good approach to set the SEO fields?
I recommend using next-seo (https://www.npmjs.com/package/next-seo).
It allows you to have a default config used for every page and override it where needed.

creating a page with more views and blocks in drupal

How to create a page containing more than one view and blocks without using page manager. If it is a home page, we can easily create by saying promote to front page.
If it is an inner page, how to map that page with more views and blocks.
Without using page manager,is it possible?
If it so,kindly share your thoughts.
You create a file with the node-page-id, for example node--1.tpl.php, where you make changes only for this specific page, and then you add your views and blocks using code,
print render($block['content']);
or
print views_embed_view('');

Can Meteor route changes without refresh/remove the previous page for overlay a page on the previous page?

Is there any method to keep previous page in the background, render the new page as an overlay with routing changed. I want to make post view pages overlay on a post list page. When the overlay page appears, the route url should change to the post page url and the post list should be visible on the background. By click back to the post list page, I can see the post list without rendering again. How to set my router for this?

Changing just the url of gallery2

I inherited a implementation of Gallery2 embedded in a Drupal site. I need to change the url of the page this is on from /gallery to /somethingelse.
Drupal is not something I am very familiar with, but I've done some stuff here and there with it years ago.
The /gallery page is not listed anywhere in the admin interface and the content is living in page-gallery.tpl.php.
A 301 redirect is going to be necessary (which I do know how to do), but that isn't the solution I'm looking for obviously (just to avoid getting that answer). Is there any simple way to change this url?
First you will have to understand how drupal handle URLs & generate a page based on it. There are several way to have a URL in drupal, where you can navigate from somewhere.
Usually we make page(add content) of some content type, which you create before with all the required fields. Drupal give serial node number to all newly created page, so to have your own custom URL, you will need to use PATHAUTO module, which will create URL based on title of the page, though you can modify at time of creating page.
We create listings of some things e.g. images for gallery by help of VIEWS & we can create page for the listing. We get to give URL for the page, which you can edit any time.
We declare URLs in our custom module under hook_menu(). Other contributed module also do the same & that's why you get some pages when you enable the module.
Apart from page content, drupal have block system. A block can contains content, image, links etc & display of it can be set to all pages as well as any specific page. So there is no limitation for you to make your page with the URL which you want if you are using PATHAUTO module. If you have listing from views or code which is generating page, then you can always go there & change.

Like button on each page

I have a like button on my main page (master page in asp.net).
I added a like button on each dynamic page.
When I try to enter the link:
http://www.friend.co.il/details.aspx?id=2321
to one of the dynamic page in face book developer page:
http://developers.facebook.com/docs/reference/plugins/like/
I get the same number of like as the total site number and not just a number for the specific page.
Any body know whats I'm doing wrong?
Using Facebook's URL Linter on your dynamic page's URL shows that it has Open Graph tags that refer to your website's main page. As a result, Facebook thinks that the canonical URL for http://www.friend.co.il/details.aspx?id=2321 is http://www.friend.co.il/.
You should either remove the meta tags from your subpages, or construct them so that they properly represent the content on each page.
Remove your og:url meta tag and also be sure to not include the Facebook javascript file multiple times like you are currently doing.

Resources