I have a data here
<div class="main-details mt10">
<div class="container">
<div class="row">
<div class="col-lg-8 col-md-7" data-purpose="introduction">
<div class="slp-jwplayer-communicator" data-fade-in="1"
data-playerhtml=' <iframe id="hh"
src="https://localhost/embed/video/E0cZc345xCVTXwT/?params%5Bvars%5D%5Bplaylist%5D%5B0%5D%5Bimage%5D=https%3A%2F%2Flocalhost.images.com%2Fckxit%2F750x422%2F469292_6c3e_5.jpg¶ms%5BtrackVideoPlay%5D=true"
width="100%"
height="100%"
frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen
style="background: black;">
</iframe>
'>
<div class="promo-asset-content stretchy-wrapper ud-courseimpressiontracker"
data-id="erew343423"
data-tracking-type="proms"
>
<div>
<img class="cth" src="https://lcoalhost/data/469292_6c3e_5.jpg"/>
</div>
</div>
</div>
</div>
<div class="col-lg-4 col-md-5">
<div class="row fxdc lf-wrap-md">
<div class="fxw-md -md db-xs">
<div class="right-top col-md-12 col-sm-6">
<div class="take-btn">
<div class="price fxac">
</div>
<a class="ct "
data-requireLogin="true"
data-les="button-enroll-b"
data-padding="0"
data-passDtCode="true"
data-purpose="take-this"
href="https://localhost/code=kKp5D213TWOo">
Take </a>
I want to find jwplayer and get everything in between src
jwplayer-communicator" data-fade-in="1"
data-playerhtml=' <iframe id="4222780"
src="https://localhost/embed/video/E0cZc345xCVTXwT/?params%5Bvars%5D%5Bplaylist%5D%5B0%5D%5Bimage%5D=https%3A%2F%2Flocalhost.images.com%2Fckxit%2F750x422%2F469292_6c3e_5.jpg¶ms%5BtrackVideoPlay%5D=true"
result:
https://localhost/embed/video/E0cZc345xCVTXwT/?params%5Bvars%5D%5Bplaylist%5D%5B0%5D%5Bimage%5D=https%3A%2F%2Flocalhost.images.com%2Fckxit%2F750x422%2F469292_6c3e_5.jpg¶ms%5BtrackVideoPlay%5D=true
However, the code below will return everything from jwplayer and text beyond the result.
data = re.search(r'jwplayer.*src=\"(.*?)\"', html, re.MULTILINE | re.DOTALL).group(1)
How can I just get everything in between src=" and " provided that it's right after jwplayer?
edit
ok I got it. html parser is better suit to work with this type of problem (html). But let's say I'm just curious as how to perform such action in regex, can anyone please help me? The information is helpful who knows I might encounter such problem in a text file in the future. Moreover, even if I use html parser, I need to pass some regex not matter what.