Is there a way to extract the value of the background-image URL that is set directly in the element tag using inline styling?
<a style="background-image: url(https:// ....)"></a>
I attempted to retrieve this information using
var url = $(this).css('background-image')
and tried various regex patterns, but unfortunately, it did not work as expected. I am looking to save this URL into MongoDB, however, when I attempt to execute the following code, I encounter an error:
var styles = parse(el.attribs.style);
TypeError: Cannot read property 'attribs' of undefined