Как получить код из письма?
-
С регуляркой не выходит как быть?
есть текст письма , нужно получить 046124 а с помощью регулярного выражения получаю 2020111
как быть?To verify your email address, please use the following One Time Password (OTP): 046124 Do not share this OTP with anyone. Amazon takes your account security very seriously. Amazon Customer Service will never ask you to disclose or verify your Amazon password, OTP, credit card, or banking account number. If you receive a suspicious email with a link to update your account information, do not click on the link—instead, report the email to Amazon for investigation. Thank you for shopping with us! We hope to see you again soon.<202011161813300fc84955edad4611bbca29c45700p0na@bounces.amazon.com> Delivered-To: gudrunicevi@rambler.ru Received: from 0vm0000.prod.mail.rambler.tech ([10.5.5.16]) by 1vm0024.prod.mail.rambler.tech with LMTP id mL/rJVXBsl9QCAAAopVFmw (envelope-from <202011161813300fc84955edad4611bbca29c45700p0na@bounces.amazon.com>) for <gudrunicevi@rambler.ru>; Mon, 16 Nov 2020 21:13:41 +0300 Received: from mx6.mail.rambler.ru ([10.5.5.16]) by 0vm0000.prod.mail.rambler.tech with LMTP id 8O+pJVXBsl8PXAAAX1OJ0w (envelope-from <202011161813300fc84955edad4611bbca29c45700p0na@bounces.amazon.com>) for <gudrunicevi@rambler.ru>; Mon, 16 Nov 2020 21:13:41 +0300 Received: from a13-95.smtp-out.amazonses.com (a13-95.smtp-out.amazonses.com [54.240.13.95]) by mx6.mail.rambler.ru (Postfix) with ESMTP id D00F96803A1 for <gudrunicevi@rambler.ru>; Mon, 16 Nov 2020 21:13:36 +0300 (MSK) Received: from a13-95.smtp-out.amazonses.com (a13-95.smtp-out.amazonses.com [54.240.13.95]) by resmtp1.mail.rambler.ru (resmtp/Rambler) with ESMTP id DZ1WwAcr; Mon, 16 Nov 2020 18:13:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=yg4mwqurec7fkhzutopddd3ytuaqrvuz; d=amazon.com; t=1605550410; h=From:To:Message-ID:Subject:MIME-Version:Content-Type:Date; bh=f9kiuLvxNscYA/SjKPn62sVW0e5Cv6rn4u5aqAPoy8E=; b=ao3M6iZOy7yGwajynegnv4FWSTw9u7v/3NmIOpnMgdmTDYsyt3m0WoFRBEA5+At8 uSqAxtGkJ7clk3o9pQoP7x4TcV6iVn/9hiyMqa5I4es4kidvONq2TSklXllZd3GiIIu PeuxpC1yRYqmOKqY+g7pIXMPjgPPSZlQ/qrq81hI= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=224i4yxa5dv7c2xz3womw6peuasteono; d=amazonses.com; t=1605550410; h=From:To:Message-ID:Subject:MIME-Version:Content-Type:Date:Feedback-ID; bh=f9kiuLvxNscYA/SjKPn62sVW0e5Cv6rn4u5aqAPoy8E=; b=PwPPKXhyH/BJbuK/1ru8IyKKV5TFA1ejfG68lgH/iaV/wiGv5TXlP/D564h17Kav LsAD0d5gmdiJ1QEPInmu1rZ8AeMApQChKC/YppXogFdb1fXMZ3Kvjnt5R31VIj8KO5y xu4JbA/dTTy9MsjJMdW521GGX8d4YKZXjwPVw+IQ= Message-ID: <01000175d24309d8-ce50ac35-a7eb-414c-8262-6d5c0287ba5a-000000@email.amazonses.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_22607878_1808208574.1605550410196" X-AMAZON-MAIL-RELAY-TYPE: notification Bounces-to: 202011161813300fc84955edad4611bbca29c45700p0na@bounces.amazon.com X-AMAZON-METADATA: CA=C39VIEGRHNUE4S X-Original-MessageID: <urn.rtn.msg.202011161813300fc84955edad4611bbca29c45700p0na@1605550410196.rtn-svc-na-back-c42xl1d-c2420c9a.us-east-1.amazon.com> Date: Mon, 16 Nov 2020 18:13:30 +0000 X-SES-Outgoing: 2020.11.16-54.240.13.95 Feedback-ID: 1.us-east-1.ZHcGJK6s+x+i9lRHKog4RW3tECwWIf1xzTYCZyUaiec=:AmazonSES <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta name="viewport" content="width=device-width"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <style type="text/css"> @media only screen and (min-width:620px) { table.body p{ font-size:14px !important; } table.body .otp{ font-size:18px !important; font-weight:bold; } table.body #title p{ font-size:20px !important; } } </style> <style> body { margin:0; color:#333; } a { text-decoration:none; color:#006699; } p { margin:0px; } img { border:0; margin:0; } /* container */ #container { width:540px; margin:0 auto; } #content { width:500px; margin:0 20px; } /* header */ #header { border-bottom:1px solid #eaeaea; padding-top:10px; padding-left:0px; padding-right:0px; padding-bottom:10px; } #title p{ font-size:26px; font-family: "arial", "sans-serif"; } #amazonLogo{ width:107px; height:31px; } #customLogo{ width:107px; height:auto; } /* verification msg */ #verificationMsg { padding-left:0; padding-top:9px; padding-bottom:9px; } #verificationMsg p { font-size:20px; font-family: "arial", "sans-serif"; } #verificationMsg .otp { font-size:24px; font-weight:bold; padding-top:18px; } /* account security */ #accountSecurity { padding-left:0; padding-top:9px; padding-bottom:9px; } #accountSecurity p { font-size:20px; font-family: "arial", "sans-serif"; } /* closing */ #closing { padding-left:0; padding-top:9px; padding-bottom:9px; } #closing p { font-size:20px; font-family: "arial", "sans-serif"; } </style> <title></title> </head> <body><img width="1" height="1" src="https://www.amazon.com/gp/r.html?C=2W75CR7G4NUVY&M=urn:rtn:msg:202011161813300fc84955edad4611bbca29c45700p0na&R=1PTYQMWPDYTJB&T=O&U=https%3A%2F%2Fimages-na.ssl-images-amazon.com%2Fimages%2FG%2F01%2Fnav%2Ftransp.gif&H=IY0TAVYYEDSZFOQ7DGELRRPTVKEA&ref_=pe_3619770_272516070_opens" /> <table align="center" cellspacing="0" id="container" cellpadding="0" class="body"> <tbody> <tr> <td> <table cellspacing="0" id="content" cellpadding="0"> <tbody> <tr> <td id="header"> <table cellspacing="0" cellpadding="0"> <tbody> <tr> <td width="250" id="logo"> <img src="https://images-na.ssl-images-amazon.com/images/G/01/x-locale/cs/te/logo._CB485949097_.png" id="amazonLogo"/> </td> <td width="250" valign="top" align="right" id="title"><p>Verify your new Amazon account</p></td> </tr> </tbody> </table> </td> </tr> <tr> <td id="verificationMsg"> <p>To verify your email address, please use the following One Time Password (OTP):</p> <p class="otp">046124</p> </td> </tr> <tr> <td id="accountSecurity"> <p>Do not share this OTP with anyone. Amazon takes your account security very seriously. Amazon Customer Service will never ask you to disclose or verify your Amazon password, OTP, credit card, or banking account number. If you receive a suspicious email with a link to update your account information, do not click on the link—instead, report the email to Amazon for investigation. </p> </td> </tr> <tr> <td id="closing"> <p>Thank you for shopping with us! We hope to see you again soon.</p> </td> </tr> </tbody> </table> </td> </tr> </tbody> </table> <img width="1" height="1" src="https://www.amazon.com/gp/r.html?C=2W75CR7G4NUVY&M=urn:rtn:msg:202011161813300fc84955edad4611bbca29c45700p0na&R=H75UYECCM1FG&T=E&U=https%3A%2F%2Fimages-na.ssl-images-amazon.com%2Fimages%2FG%2F01%2Fnav%2Ftransp.gif&H=CWYSCZKHM1XYJ4YQSFGJF8FQDUGA&ref_=pe_3619770_272516070_open" /></body> </html>
-
@capsslpck попробуйте через XPATH
//p[@class="otp"]
-
@bigorat said in Как получить код из письма?:
//p[@class="otp"]
не получаеться а может я что то не так делаю. //p[@class="otp"] как регулярное вырожение?
-
@capsslpck я же написал, - попробуйте через XPATH, где тут регулярное выражение?
-
@bigorat
Спасибо помогло )))