public void getImgs(string _html) { Regex rxImages = new Regex("<img.+?src=[\"'](.+?)[\"'].+?>", RegexOptions.IgnoreCase & RegexOptions.IgnorePatternWhitespace); MatchCollection mc = rxImages.Matches(_html); foreach(Match m in mc) { Console.WriteLine(m.Groups[0].Value); Console.WriteLine(m.Groups[1].Value); } } result: 0: < img src = "http://yeonpil.org/소녀시대.jpg" / > 1: http: //yeonpil.org/소녀시대.jpg
2012/07/11
c#, html 에서 img src 경로 가져오기
가장 많이 본 글
-
처리되지 않은 예외: System.Security.Authentication.AuthenticationException: SSPI를 호출하지 못했습니다. 내부 예외를 참조하십시오. ---> System.ComponentModel.Win32Exce...
-
심각도 코드 설명 프로젝트 파일 줄 비표시 오류(Suppression) 상태 오류 Failed to add reference to 'System.Linq'. Please make sure that it is i...
-
기존 Webapp 에 컴파일 버전이 2.x 인데, Nuget 에서 3.8 로 업그레이드 실행. 그런데 오류나 가서 완료되지 않았고,.. 다른 MS 기본 라이브러리 업데이트도 안됨.. 다시 VS 실행하니 참조 라이브러리 모두 오류.. ◯◯◯◯.csp...
댓글 없음:
댓글 쓰기