한다고 가정 내가 데이터를 다음 한 파일이 : 내가 제목 후 문자열을 가져 오지 수있는 방법이 위의 문자열에서인쇄 파이썬
<td class="w"><a href="show.cgi?id=120012" title="[Title] @Blue: Session_TIMEOUT after 60033 ms">[Title] @Blue: Session_TIMEOUT after 60033 ms</a></td>'
<td class="w"><a href="show.cgi?id=120012" title="[Title] @Blue: Session_TIMEOUT after 60500 ms">[Title] @Blue: Session_TIMEOUT after 60033 ms</a></td>'
을 = "[제목] @ 블루 : 6003 ms 후 Session_TIMEOUT "을 HTML 태그 아래에있는 행과 다음 행에 검색된 문자열을 씁니다.
나는 출력과 같이합니다 :
<td class="w"><a href="show.cgi?id=120012" title="[Title] @Blue: Session_TIMEOUT after 60033 ms">[Title] @Blue: Session_TIMEOUT after 60033 ms</a></td>'
@Blue: Session_TIMEOUT after 60033 ms
<td class="w"><a href="show.cgi?id=120012" title="[Title] @Blue: Session_TIMEOUT after 60500 ms">[Title] @Blue: Session_TIMEOUT after 60033 ms</a></td>'
@Blue: Session_TIMEOUT after 60500 ms
당신은 regulare 표현을 사용할 수 있습니다 사전
에서 언급 한 바와 같이 이것에 대해 갈 수있는 더 좋은 방법은 정규 표현식을 사용하는 것입니다,하지만 . –