def fix_missing_electronic_locator_tag(dom, url):
electronic_locator = dom.match(<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",<EOL>)<EOL>if electronic_locator:<EOL><INDENT>return<EOL><DEDENT>location = dom.match("<STR_LIT>", "<STR_LIT>")<EOL>if location:<EOL><INDENT>location = first(location)<EOL><DEDENT>else:<EOL><INDENT>location_tag = dhtmlparser.parseString(<EOL>"<STR_LIT>"<EOL>)<EOL>insert_tag(<EOL>location_tag,<EOL>dom.find("<STR_LIT>"),<EOL>get_mods_tag(dom)<EOL>)<EOL>location = first(dom.match("<STR_LIT>", "<STR_LIT>"))<EOL><DEDENT>replacer = dhtmlparser.parseString("""<STR_LIT>""" + url + """<STR_LIT>""")<EOL>location.replaceWith(<EOL>first(replacer.find("<STR_LIT>"))<EOL>)<EOL>
In case that MODS contains no URL and the location is wrong (physical), add
url from `url` parameter.