O
O
Oleg Mifle2016-11-19 22:34:44
1C-Bitrix
Oleg Mifle, 2016-11-19 22:34:44

How to validate the HTML code of a page?

Actually, the task is as follows:
Implement notification of the site administrator by email about an error in the site content.

  • Check website page /products/
  • If the page does not contain the word "Era" (product name), then send an
    email to the administrator: "Attention, an error in the catalog!"
  • The administrator must be able to edit the email template
  • It is enough if an entry about the letter appeared in the corresponding database table, i.e. it's in the queue for shipping.

With sending a notification, everything is clear. But how to check the html code of the page? I don't know such an API method, but I don't think that the task should be solved using curl. Does anyone have any thoughts on this? I've already broken my head.
This task is from the developer's bitrix exam ticket, so I think that you should use the apish, not the curl.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Korolev, 2016-11-19
@OlegMifle

As an option - add your own event handler OnEndBufferContent, in which a regular expression check for the presence of the word "Era", and if the word is missing, send a mail event. And additionally, in this handler, check that we are on the /products/ page.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question