From this url: https://www.amazon.com/dp/073532753X?smid=A3P5ROKL5A1OLE I want to get a line between var iframeContent =andobj.onloadCallback = onloadCallback;
var iframeContent =
obj.onloadCallback = onloadCallback;
I have this regex iframeContent(.*?)obj.onloadCallback = onloadCallback;
iframeContent(.*?)obj.onloadCallback = onloadCallback;
But that will not work. I am not good at regular expression, so please apologize for the lack of knowledge.
I even tried iframeContent(.*?)obj.onloadCallback, but it does not work.
iframeContent(.*?)obj.onloadCallback
, . , . DOTALL, , . , - , , , , , .
DOTALL
.
,
m = re.search(r'var iframeContent = \"([^"]+)\"', html_source) print m.group(1)
, [^"], . , , .
[^"]
, . re.M (.. re.findall('someString', text_Holder, re.M)).
re.M
re.findall('someString', text_Holder, re.M)
(?<=iframeContent =)(.*)(?=obj.onloadCallback = onloadCallback)
You can check this site in the test.
It is very important to use the mode DOTALL, which means that you will have a single line
Source: https://habr.com/ru/post/1658281/More articles:Angular 2 using Angular Cli and Ui Router Ng2, Resolve / Reject - angularAzure DocumentDb storage limits - what exactly do they mean? - azure-cosmosdbWhere to post generic CSS in Angular 2 - cssAn object reference is required for a non-static field, method or property - initializationGet the latest entries for every ORACLE number - sqlHide content dynamically with React - javascriptAngular2 Refusal of a raw promise: template parsing errors: - angularGoogle Drive Auth always returns 0 - google-play-servicesHow to allow null when using web services in codename - phpHow to use tf.string_split () in a tensor stream? - tensorflowAll Articles