I am trying to get value from this attribute
:news-item-data
type <div id="app">
<div >
<news-item :news-item-data="{"id":248934,"url":"na-treh-ulicah-gorroshi-otklyuchili-holodnuyu-vodu-248934","title":"\u041d\u0430\u00a0\u0442\u0440\u0435\u0445 \u0443\u043b\u0438\u0446\u0430\u0445 \u0413\u043e\u0440\u0440\u043e\u0449\u0438 \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u043b\u0438 \u0445\u043e\u043b\u043e\u0434\u043d\u0443\u044e \u0432\u043e\u0434\u0443","date":"2022-03-25T06:58:03.000000Z","notice":"\u0412\u00a0\u0441\u043f\u0438\u0441\u043e\u043a \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043f\u043e\u043f\u0430\u043b\u0438 \u0436\u0438\u043b\u044b\u0435 \u0434\u043e\u043c\u0430, \u0442\u0435\u0445\u043d\u043e\u043f\u0430\u0440\u043a \u00ab\u041a\u0432\u0430\u043d\u0442\u043e\u0440\u0438\u0443\u043c \u00ab\u0414\u0440\u0443\u0436\u0431\u0430\u00bb, \u0434\u0435\u0442\u0441\u043a\u0430\u044f \u043f\u043e\u043b\u0438\u043a\u043b\u0438\u043d\u0438\u043a\u0430 \u2116\u20091 \u0438\u00a0\u043e\u043d\u043a\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0434\u0438\u0441\u043f\u0430\u043d\u0441\u0435\u0440.","body":"<p>\u041d\u0430\u00a0\u0442\u0440\u0435\u0445 \u0443\u043b\u0438\u0446\u0430\u0445 \u0413\u043e\u0440\u0440\u043e\u0449\u0438 \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u043b\u0438 \u0445\u043e\u043b\u043e\u0434\u043d\u0443\u044e \u0432\u043e\u0434\u0443. \u041e\u0431\u00a0\u044d\u0442\u043e\u043c \u0441\u043e\u043e\u0431\u0449\u0438\u043b\u0438 \u043d\u0430 <noindex><a rel=\"nofollow\" target=\"_blank\"href=\"https:\/\/vodokanalryazan.ru\/press-tsentr\/remontnye-raboty\/:otklyuchenie-holodnoj-vody-25032022\">\u0441\u0430\u0439\u0442\u0435<\/a><\/noindex> \u0440\u044f\u0437\u0430\u043d\u0441\u043a\u043e\u0433\u043e \u0432\u043e\u0434\u043e\u043a\u0430\u043d\u0430\u043b\u0430. <\/p>\r\n<p>\u0412\u00a0\u043f\u044f\u0442\u043d\u0438\u0446\u0443, 25\u00a0\u043c\u0430\u0440\u0442\u0430, \u0441\u00a009:30 \u0434\u043e\u00a017:00 \u0445\u043e\u043b\u043e\u0434\u043d\u0443\u044e \u0432\u043e\u0434\u0443 \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u043b\u0438 \u043f\u043e\u00a0\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0430\u0434\u0440\u0435\u0441\u0430\u043c: <\/p>\n<ul>\n<li>\u0443\u043b\u0438\u0446\u0430 \u0412\u044b\u0441\u043e\u043a\u043e\u0432\u043e\u043b\u044c\u0442\u043d\u0430\u044f, \u0434\u043e\u043c \u2116\u20095 \u043a\u043e\u0440\u043f\u0443\u0441 1; <\/li>\n<li>\u0422\u0440\u043e\u043b\u043b\u0435\u0439\u0431\u0443\u0441\u043d\u044b\u0439 \u043f\u0435\u0440\u0435\u0443\u043b\u043e\u043a, \u0434\u043e\u043c\u0430 \u2116\u2116\u20094, 6;<\/li>\n<li>\u0443\u043b\u0438\u0446\u0430 \u0414\u0437\u0435\u0440\u0436\u0438\u043d\u0441\u043a\u043e\u0433\u043e, \u0434\u043e\u043c\u0430 \u0441\u00a04 \u043f\u043e\u00a018 (\u0447\u0435\u0442\u043d\u0430\u044f \u0441\u0442\u043e\u0440\u043e\u043d\u0430), \u0441\u00a07 \u043f\u043e\u00a013 (\u043d\u0435\u0447\u0435\u0442\u043d\u0430\u044f \u0441\u0442\u043e\u0440\u043e\u043d\u0430), 6 (\u0434\u0435\u0442\u0441\u043a\u0438\u0439 \u0442\u0435\u0445\u043d\u043e\u043f\u0430\u0440\u043a \u00ab\u041a\u0432\u0430\u043d\u0442\u043e\u0440\u0438\u0443\u043c \u00ab\u0414\u0440\u0443\u0436\u0431\u0430\u00bb), 8 \u0438\u00a016-\u0430 (\u0434\u0435\u0442\u0441\u043a\u0430\u044f \u043f\u043e\u043b\u0438\u043a\u043b\u0438\u043d\u0438\u043a\u0430 \u2116\u20091), 11 (\u043e\u0431\u043b\u0430\u0441\u0442\u043d\u043e\u0439 \u043a\u043b\u0438\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043e\u043d\u043a\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0434\u0438\u0441\u043f\u0430\u043d\u0441\u0435\u0440).<\/li>\n<\/ul>\n<p>\u041f\u0440\u0438\u0447\u0438\u043d\u0430 \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f\u00a0\u2014 \u0440\u0435\u043c\u043e\u043d\u0442\u043d\u044b\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u00a0\u0432\u043e\u0434\u043e\u043f\u0440\u043e\u0432\u043e\u0434\u0435. <\/p>","date_insert":"2022-03-25T06:59:48.000000Z","active":true,"image":null,"old":false,"is_comment":true,"is_priority":false,"metadata":false,"is_mail":true,"comments_count":0,"read_count":92,"image_1":"2022\/03\/248934\/248934_623d6864d19fa.jpg","section_meta":null,"gallery":false,"photographer_id":null,"is_ad":false,"is_priority_small":false,"editor_id":19591,"indexation_inner_link":false,"injection":null,"material_id":null,"photobank_id":null,"annotation":null,"is_telegram":false,"is_bisy":false,"image_2":"2022\/03\/248934\/248934_623d6864d19fa_x2.jpg","rate_plus":0,"rate_minus":0,"fb_post_id":null,"fb_status":null,"fb_instant_article":null,"google_shortlink":null,"news_rss":null,"is_telegram_mainchannel":false,"totalSocialCount":0,"is_yandexturbo":false,"is18":false,"source_type":null,"region_groups":false,"fb_post_url":null,"social_is_sent":true,"tg_post_id":"113523","ok_post_id":"153952320566716","tg_post_url":"https:\/\/t.me\/rzninfo_news_channel\/113523","ok_post_url":"https:\/\/ok.ru\/group\/51938318221500\/topic\/153952320566716","image_1_compressed":"2022\/03\/248934\/248934_623d6864d19fa_compressed.jpg","image_1_x2":null,"image_1_compressed_x2":null,"image_social_compressed_x2":null,"is_new_admin":true,"placeholder":false,"image_600_400":"2022\/03\/248934\/248934_623d6864d19fa_600_400.jpg","image_300_200":"2022\/03\/248934\/248934_623d6864d19fa_300_200.jpg","image_2_compressed":"2022\/03\/248934\/248934_623d6864d19fa_x2_compressed.jpg","created_at":"2022-03-25T06:59:48.000000Z","updated_at":"2022-03-25T06:59:49.000000Z","is_delayed":false,"commentsTree":[],"isShowComments":false,"inBookmarks":false,"socialImagesOpengraph":"https:\/\/cdn9.rzn.info\/data\/image\/newsadd\/base\/2022\/03\/248934\/socials\/248934_623d6864d19fa_social_openGraph.jpg","socialImagesVk":"https:\/\/cdn7.rzn.info\/data\/image\/newsadd\/base\/2022\/03\/248934\/socials\/248934_623d6864d19fa_social_vk.jpg","socialImagesTwitter":"https:\/\/cdn9.rzn.info\/data\/image\/newsadd\/base\/2022\/03\/248934\/socials\/248934_623d6864d19fa_social_twitter.jpg","socialImagesFacebook":"https:\/\/cdn8.rzn.info\/data\/image\/newsadd\/base\/2022\/03\/248934\/socials\/248934_623d6864d19fa_social_fb.jpg","socialImagesOk":"https:\/\/cdn7.rzn.info\/data\/image\/newsadd\/base\/2022\/03\/248934\/socials\/248934_623d6864d19fa_social_ok.jpg","socialImagesTg":"https:\/\/cdn10.rzn.info\/data\/image\/newsadd\/base\/2022\/03\/248934\/socials\/248934_623d6864d19fa_social_telegram.jpg","comments_count_label":"\u041f\u0440\u043e\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c","date_formatted":"23 \u043c\u0438\u043d\u0443\u0442\u044b \u043d\u0430\u0437\u0430\u0434","read_count_formatted":"92","comment_count_formatted":"0","public_url":"https:\/\/www.rzn.info\/news\/2022\/3\/25\/na-treh-ulicah-gorroshi-otklyuchili-holodnuyu-vodu-248934.html","desktop_url":"https:\/\/www.rzn.info\/news\/2022\/3\/25\/na-treh-ulicah-gorroshi-otklyuchili-holodnuyu-vodu-248934.html","mobile_url":"https:\/\/m.rzn.info\/news\/2022\/3\/25\/na-treh-ulicah-gorroshi-otklyuchili-holodnuyu-vodu-248934.html","image_1_public_url":"https:\/\/cdn7.rzn.info\/data\/image\/newsadd\/base\/2022\/03\/248934\/248934_623d6864d19fa_compressed.jpg","image_2_public_url":"https:\/\/cdn6.rzn.info\/data\/image\/newsadd\/base\/2022\/03\/248934\/248934_623d6864d19fa_x2_compressed.jpg","image_600_400_public_url":"https:\/\/cdn6.rzn.info\/data\/image\/newsadd\/base\/2022\/03\/248934\/248934_623d6864d19fa_600_400.jpg","image_300_200_public_url":"https:\/\/cdn6.rzn.info\/data\/image\/newsadd\/base\/2022\/03\/248934\/248934_623d6864d19fa_300_200.jpg","stories":[],"sections":[{"id":1,"title":"\u0420\u044f\u0437\u0430\u043d\u044c","url":"ryazan","parent":0,"order":100,"on_main":true,"public_url":"https:\/\/www.rzn.info\/news\/ryazan","desktop_url":"https:\/\/www.rzn.info\/news\/ryazan","mobile_url":"https:\/\/m.rzn.info\/news\/ryazan","pivot":{"data_id":248934,"section_id":1}},{"id":14,"title":"\u0416\u041a\u0425 \u0438 \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442","url":"services-and-transport","parent":0,"order":96,"on_main":false,"public_url":"https:\/\/www.rzn.info\/news\/services-and-transport","desktop_url":"https:\/\/www.rzn.info\/news\/services-and-transport","mobile_url":"https:\/\/m.rzn.info\/news\/services-and-transport","pivot":{"data_id":248934,"section_id":14}}],"comments":[],"galleries":null,"areas":[],"photobank":null,"authors":[],"resource":{"id":249983,"date":"2022-03-25T06:59:48.000000Z","new_id":248934,"article_id":null,"business_id":null,"seriously_id":null,"active":true,"tags":[]},"social_images":{"id":11767,"type_and_realization":"news","data_id":248934,"active_theme":"horizontal","opengraph":"2022\/03\/248934\/socials\/248934_623d6864d19fa_social_openGraph.jpg","vk":"2022\/03\/248934\/socials\/248934_623d6864d19fa_social_vk.jpg","fb":"2022\/03\/248934\/socials\/248934_623d6864d19fa_social_fb.jpg","twitter":"2022\/03\/248934\/socials\/248934_623d6864d19fa_social_twitter.jpg","ok":"2022\/03\/248934\/socials\/248934_623d6864d19fa_social_ok.jpg","tg":"2022\/03\/248934\/socials\/248934_623d6864d19fa_social_telegram.jpg","created_at":"2022-03-25T06:59:49.000000Z","updated_at":"2022-03-25T06:59:49.000000Z"},"bookmark":null}"
:icon-comment=""https:\/\/www.rzn.info\/assets\/images\/design\/sprite.svg#icon-comment""
:icon-eye=""https:\/\/www.rzn.info\/assets\/images\/design\/sprite.svg#icon-eye""
:icon-bookmark=""https:\/\/www.rzn.info\/assets\/images\/design\/sprite.svg#icon-bookmark""
:icon-facebook=""https:\/\/www.rzn.info\/assets\/images\/design\/sprite.svg#icon-facebook""
:icon-vk=""https:\/\/www.rzn.info\/assets\/images\/design\/sprite.svg#icon-vkontakte""
:icon-telegram=""https:\/\/www.rzn.info\/assets\/images\/design\/sprite.svg#icon-telegram""
:icon-twitter=""https:\/\/www.rzn.info\/assets\/images\/design\/sprite.svg#icon-twitter""
:icon-odboklassniki=""https:\/\/www.rzn.info\/assets\/images\/design\/sprite.svg#icon-odnoklassniki""
:add-comment-url=""https:\/\/www.rzn.info\/ajax\/newsitem\/addComment\/""
:add-like-url=""https:\/\/www.rzn.info\/ajax\/newsitem\/addlike\/""
:next-item-url=""https:\/\/www.rzn.info\/ajax\/newsitem\/next\/""
:user-id="null"
:token=""H9cvR75xBtprSNSxTFtW8RB7YkROKMIsZQHYsMoY""
:current-rubric=""services-and-transport""
:spinner=""https:\/\/www.rzn.info\/assets\/images\/design\/spinner.svg""
:city=""ryazan""
:city-trans=""\u0420\u044f\u0437\u0430\u043d\u044c""
:add-to-bookmarks-url=""https:\/\/www.rzn.info\/ajax\/newsitem\/addToBookmarks\/""
:remove-from-bookmarks-url=""https:\/\/www.rzn.info\/ajax\/newsitem\/removeFromBookmarks\/"">
</news-item>
</div>
<div >here
But i dont know how to get :attribute value.
Usually i use something like //div[contains(@class, 'col9')]/news-item/@news-item-data but here a i have : before news-item-data, so how do i get value inside :news-item-data using xpath?
I tried //div[contains(@class, 'col9')]/news-item/@news-item-data expected to get value inside of :news-item-data
CodePudding user response:
To select the :news-item-data
attribute value in XML you presenting here you can use this XPath:
//div[contains(@class, 'col-8')]/news-item/@*[name()=':news-item-data']
UPD
I could not find the XML block on the link you provided in the comment. Possibly the web site is dynamic.
You can see my XPath applied to XML you provided in the question here: :
Generally it's a nice online XPath simulator