| 2167 | } |
| 2168 | // 通用型获取下一页地址(从 元素 中获取页码,URL 替换 pathname 路径) |
| 2169 | function getNextEPN(css, reg, a, b = '') { |
| 2170 | let nextNum = getOne(css), url = ''; |
| 2171 | if (nextNum && nextNum.textContent) { |
| 2172 | nextNum = nextNum.textContent.replaceAll(' ',''); |
| 2173 | if (location.pathname) { |
| 2174 | if (indexOF(reg)) { |
| 2175 | url = location.pathname.replace(reg, a + nextNum + b); |
| 2176 | } else { |
| 2177 | url = location.pathname + a + nextNum + b; |
| 2178 | } |
| 2179 | } else { |
| 2180 | url = location.pathname + a + nextNum + b; |
| 2181 | } |
| 2182 | url = location.origin + url + location.search; |
| 2183 | } |
| 2184 | return url |
| 2185 | } |
| 2186 | // 通用型获取下一页地址(从 URL 中获取页码,并页码+1,URL 替换 pathname 路径,后三个参数可以省略) |
| 2187 | function getNextUPN(urlReg, reg, a, b = '', initP = '2', endP) { |
| 2188 | let nextNum = urlReg.exec(location.pathname); |