Как здесь спарсить ссылку?
-
[668123601] [23:29:39] Поток №1 : {"status":"OK","value":"","type":"text/html","fullmessage":"<!DOCTYPE html><html> <head> <title>Активировать учетную запись</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <style type="text/css"> body, table { font-family: 'Roboto', Roboto, Arial, Helvetica, sans-serif; font-smoothing: antialiased; -moz-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; -webkit-font-smoothing: antialiased; } table { border-collapse: collapse; width: 100%; } a, a:hover { text-decoration: none !important; } @media only screen and (max-width: 480px) { body, table, td, p, a, li, blockquote { -webkit-text-size-adjust: none !important; } *[class].responsive-full { width: 100% !important; } *[class].responsive-block { display: block !important; width: 100% !important; height: auto !important; } *[class].responsive-image img { height: auto !important; max-width: 100% !important; width: 100% !important; } *[class].responsive-hidden { display: none !important; } *[class].responsive-center { text-align: center !important; } *[class].responsive-block-center { margin: 0 auto !important; } } </style> </head> <body bgcolor="#f2f4f5" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" > <table class="responsive-full" border="0" cellpadding="0" cellspacing="0" style=" font-size:14px; color:#406367; background-color:#f2f4f5; " lang="ru" title="OLX.ua" > <tr> <td class="responsive-hidden"></td> <td valign="top" width="600px"> <!-- Content body --> <table border="0" cellpadding="0" cellspacing="0" style=" background:#ffffff; margin-top: 16px; " > <tr> <td valign="top"> <a href="https://www.olx.ua/?bs=siren_account_needs_confirmation&utm_source=siren&utm_medium=email&utm_campaign=account_needs_confirmation" class="responsive-block-center" target="_blank" style="width: 100%; display:block;" > <!-- Header image --> <img src="https://ireland.apollo.olxcdn.com/v1/files/dq7c4p9kzce61-HVYMSB/image;f=png" style="width: 100%; display: block;" border="0" /> </a> </td> </tr> <tr> <td style=" text-align:center; padding: 40px; background: #FFFFFF; " > <table border="0" cellpadding="0" cellspacing="0" > <tr> <td style="text-align: left;"> <h4 style=" font-size: 24px; font-weight: strong; line-height: 1.2; margin: 0 0 32px 0; color: #002f34; text-align: center; " > Чтобы завершить процесс регистрации нажмите на кнопку ниже. </h4> </td> </tr> <tr> <td colspan="2" style="text-align:center;padding: 8px 0;"> <a href="https://www.olx.ua/account/confirm/?email=5c6888d49tBIZiZr%2BLOcUHNX%2BQzs4Ph7dqXziT2c&hash=0ddc6d7658669df2f4786803b47db976&ts=1603571157&p=4f2bb2b7%2FpwoZfpZD%2FQ%3D&vk=0&sign=w2BGpTAgHQcqIcyV4Ewh0fQjFGXX9h03KD0_AYOyl-tGtvdYa93_Ew~~&bs=siren_account_needs_confirmation&utm_source=siren&utm_medium=email&utm_campaign=account_needs_confirmation" style=" color: #ffffff; display:inline-block; background-color:#002f34; line-height:20px; padding: 12px 24px; text-align:center; font-weight:bold; font-size:16px; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; " > Активируйте учетную запись </a> </td> </tr> </table> </td> </tr> </table> <!-- Footer --> <table border="0" cellpadding="0" cellspacing="0" style=" background-color:#FFFFFF; margin-bottom: 16px; width: 100%; " > <tr> <td style=" padding:32px 0px; text-align:center; width: 100%; " > <a href="https://help.olx.ua/" style=" margin: 0 16px; font-size: 12px; line-height: 1.5; text-align: center; color: #002f34; text-transform: uppercase; font-weight: bold; letter-spacing: 0.5px " >Помощь</a > <a href="https://www.olx.ua/lp/delivery/" style=" margin: 0 16px; font-size: 12px; line-height: 1.5; text-align: center; color: #002f34; text-transform: uppercase; font-weight: bold; letter-spacing: 0.5px " >OLX Доставка</a > <a href="https://www.olx.ua/myaccount/?bs=siren_account_needs_confirmation&utm_source=siren&utm_medium=email&utm_campaign=account_needs_confirmation" style=" margin: 0 16px; font-size: 12px; line-height: 1.5; text-align: center; color: #002f34; text-transform: uppercase; font-weight: bold; letter-spacing: 0.5px " >Мой профиль</a > </td> </tr> <tr> <td style=" background: #fafbfb; padding: 24px 0px; text-align: center; " > <span style=" color: #7f9799; font-size:12px; display: inline-block; " > Это сообщение было отправлено автоматически. Пожалуйста, не отвечайте на него. </span> </td> </tr> </table> </td> <td class="responsive-hidden"></td> </tr> </table> <img alt="" src="http://ty5gwwjs.r.eu-west-1.awstrack.me/I0/010201755c4a0dc3-9e915a6f-21e1-444d-9f7a-71f30eef2a25-000000/Du_Ij-Zu7Nd0QEHxFreQD6LpalM=185" style="display: none; width: 1px; height: 1px;"></body></html>"}
-
-
@UserFalse said in Как здесь спарсить ссылку?:
Не всегда вытаскивает полные ссылки, и обрезает их.
Можно извращенно регуляркойhref="(https://www\.olx\.ua/account/confirm/\?email=[\s\S]+confirmation)"\ style="\ color:
-
@Rema2005 said in Как здесь спарсить ссылку?:
account_needs_confirmation
XPATH_TEXT //a[contains(@href, "account_needs_confirmation")]/@href
-
@SotkaDaily спс
-
-
@SotkaDaily ОНо без ссылок что бы подтвердить вытаскивает :(
https://www.olx.ua/?bs=siren_account_needs_confirmation&utm_source=siren&utm_medium=email&utm_campaign=account_needs_confirmation
-
@UserFalse У меня через kopeechka Как мне взять ссылку из запроса ?
-
@Rema2005 копеечка чаще всего сама распарсивает ссылки и возвращает не полное письмо, а только ссылку. Почитай документацию.
а так я скинул тебе регурялку выше которая точно вытаскивает полную ссылку
-
@timmykr ну вот тут она не распарсила и мне полное письмо в ответе пришло. И мне надо именно ссылку взять, а как????
-
@Rema2005 применить регулярное выражение что я скинул выше
-
@timmykr А куда его?
-
ну если полный текст как Вы привели в Топике находится в письме (МАЙЛ_БОДИ) то ХРАТН в этой переменной всё найдет.
Да, кажется я понял, наверное я взял сигнатуру ошибочно и хратн забирает "первую". Извиняюсь
Пробуйте вот так
//a[contains(@href, "olx.ua/account/confirm")]/@href
-
@SotkaDaily АААААААААААААААААА Я ТУПОЙ У МЕНЯ НИЧЕГО НЕ ПОЛУЧАЕТСЯ
-
This post is deleted!
-
[Решено через Xpath]